ResponseLogger class

The ResponseLogger is a default logger implementation for the responses. Here is how the logged response's structure looks like.

← RESPONSE ←

BODY:

Here is how real logged PUT request's response looks like in the console.

← RESPONSE ← PUT: https://example.com/api/v1/user/324234 CODE: 200 HEADERS: connection : keep-alive date : Thu, 04 May 2023 19:02:10 GMT transfer-encoding : chunked vary : accept-encoding content-encoding : gzip strict-transport-security : max-age=15724800; includeSubDomains content-type : application/json

BODY: {"message":"Success"}

The ResponseLogger is a descendant of RestMiddleware, you can derive from the RestMiddleware and create you own response logger.

Inheritance

Constructors

ResponseLogger({Set<LogParts> logParts = LogParts.all})

Properties

hashCode int
The hash code for this object.
no setterinherited
logParts Set<LogParts>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addNext(RestMiddleware<RestRowResponse> middleWare) → void
This method adds a middleware to the chain. This method is called by the Rest library, no need to call it manually, instead use RestClientBuilder.addRequestMiddleware and RestClientBuilder.addResponseMiddleware
inherited
next(RestRowResponse row) Future<RestRowResponse>
This method will call next middleware in the chain. Initially this method get called by the RestClient.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onNext(RestRowResponse row, RestMiddleware<RestRowResponse> nextMiddleware) Future<RestRowResponse>
Override this method and implement your custom logic inside it. After call await nextMiddleware.next(row) to run the next middleware in the chain.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited