ISpectHttpInterceptorSettings class

ISpectHttpInterceptor settings and customization.

Constructors

ISpectHttpInterceptorSettings({bool enabled = true, bool enableRedaction = true, bool printResponseData = true, bool printResponseHeaders = false, bool printResponseMessage = true, bool printErrorData = true, bool printErrorHeaders = true, bool printErrorMessage = true, bool printRequestData = true, bool printRequestHeaders = false, AnsiPen? requestPen, AnsiPen? responsePen, AnsiPen? errorPen, @Deprecated('Use requestChain instead') bool requestFilter(BaseRequest request)?, @Deprecated('Use responseChain instead') bool responseFilter(BaseResponse response)?, @Deprecated('Use errorChain instead') bool errorFilter(BaseResponse response)?, NetworkFilterChain<BaseRequest>? requestChain, NetworkFilterChain<BaseResponse>? responseChain, NetworkFilterChain<BaseResponse>? errorChain})
const

Properties

enabled bool
Enable HTTP request/response logging when true.
finalinherited
enableRedaction bool
Enable sensitive data redaction when true (default: true).
finalinherited
errorChain → NetworkFilterChain<BaseResponse>?
Filter chain for errors. Takes priority over errorFilter.
final
errorFilter bool Function(BaseResponse response)?
For error filtering. You can add your custom logic to log only specific HTTP errors.
final
errorPen → AnsiPen?
Custom AnsiPen for error log console output.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
printErrorData bool
Print error body in the log message.
finalinherited
printErrorHeaders bool
Print error headers in the log message.
finalinherited
printErrorMessage bool
Print error status message in the log message.
finalinherited
printRequestData bool
Print request body in the log message.
finalinherited
printRequestHeaders bool
Print request headers in the log message.
finalinherited
printResponseData bool
Print response body in the log message.
finalinherited
printResponseHeaders bool
Print response headers in the log message.
finalinherited
printResponseMessage bool
Print response status message in the log message.
finalinherited
requestChain → NetworkFilterChain<BaseRequest>?
Filter chain for requests. Takes priority over requestFilter.
final
requestFilter bool Function(BaseRequest request)?
For request filtering. You can add your custom logic to log only specific HTTP requests.
final
requestPen → AnsiPen?
Custom AnsiPen for request log console output.
finalinherited
responseChain → NetworkFilterChain<BaseResponse>?
Filter chain for responses. Takes priority over responseFilter.
final
responseFilter bool Function(BaseResponse response)?
For response filtering. You can add your custom logic to log only specific HTTP responses.
final
responsePen → AnsiPen?
Custom AnsiPen for response log console output.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({bool? enabled, bool? enableRedaction, bool? printResponseData, bool? printResponseHeaders, bool? printResponseMessage, bool? printErrorData, bool? printErrorHeaders, bool? printErrorMessage, bool? printRequestData, bool? printRequestHeaders, AnsiPen? requestPen, AnsiPen? responsePen, AnsiPen? errorPen, bool requestFilter(BaseRequest request)?, bool responseFilter(BaseResponse response)?, bool errorFilter(BaseResponse response)?, NetworkFilterChain<BaseRequest>? requestChain, NetworkFilterChain<BaseResponse>? responseChain, NetworkFilterChain<BaseResponse>? errorChain}) ISpectHttpInterceptorSettings
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldProcessError(BaseResponse value) bool
Returns true when the error should be logged.
shouldProcessRequest(BaseRequest value) bool
Returns true when the request should be logged.
shouldProcessResponse(BaseResponse value) bool
Returns true when the response should be logged.
toString() String
A string representation of this object.
inherited

Operators

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