PopNetworkLogInterceptor class

PopNetworkLogInterceptor is used to print logs during network requests.

It's better to add PopNetworkLogInterceptor to the tail of the interceptor queue, otherwise the changes made in the interceptor behind A will not be printed out. This is because the execution of interceptors is in the order of addition.

Constructors

PopNetworkLogInterceptor({bool showRequestHeader = false, bool showRequestBody = true, bool showRequest = true, bool showResponseHeader = false, bool showResponseBody = true, bool showError = true, void logPrint(Object object) = print})

Properties

hashCode int
The hash code for this object.
no setterinherited
logPrint ↔ void Function(Object object)
Log printer; defaults print log to console. In flutter, you'd better use logPrint. you can also write log in a file, for example:
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showError bool
showError indicates if the error should be logged.
getter/setter pair
showRequest bool
showRequest indicates if the request Options.uri should be logged.
getter/setter pair
showRequestBody bool
showRequestBody indicates if the request Options.data should be logged.
getter/setter pair
showRequestHeader bool
showRequestHeader indicates if the request Options.headers should be logged.
getter/setter pair
showResponseBody bool
showResponseBody indicates if the response Response.data should be logged.
getter/setter pair
showResponseHeader bool
showResponseHeader indicates if the response Response.headers should be logged.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(DioException err, ErrorInterceptorHandler handler) → void
Called when an exception was occurred during the request.
onRequest(RequestOptions options, RequestInterceptorHandler handler) → void
Called when the request is about to be sent.
onResponse(Response response, ResponseInterceptorHandler handler) → void
Called when the response is about to be resolved.
toString() String
A string representation of this object.
inherited

Operators

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