EffDioLogger class

Implementers

Constructors

EffDioLogger({bool request = true, bool requestHeader = true, bool requestBody = true, bool responseHeader = false, bool responseBody = true, bool error = true, bool filter(RequestOptions options, FilterArgs args)?, int lineWidth = 162, bool compact = true, bool prettyJson = false, int? maxWidth = 324, void logPrint(Object object)?, String logLineBreak = '\n', bool enabled = true, String? reqExtra(RequestOptions req)?, String? rspExtra(Response rsp)?, String? errExtra(DioException err)?})
EffDioLogger.compat({bool request = true, bool requestHeader = false, bool requestBody = false, bool responseHeader = false, bool responseBody = true, bool error = true, bool filter(RequestOptions options, FilterArgs args)?, int lineWidth = 162, int? maxWidth = 324, bool compact = true, bool prettyJson = false, void logPrint(Object object)?, String logLineBreak = '\n', bool enabled = true, String? reqExtra(RequestOptions req)?, String? rspExtra(Response rsp)?, String? errExtra(DioException err)?})
兼容 EfficientDioLogger 默认构造的输出行为.

Properties

compact bool
Print compact json response
final
enabled bool
Enable logPrint
final
errExtra String? Function(DioException err)?
final
error bool
Print error message
final
filter bool Function(RequestOptions options, FilterArgs args)?
Filter request/response by RequestOptions
final
hashCode int
The hash code for this object.
no setterinherited
lineWidth int
Determine the width of the dividing line printLine 决定分割线的宽度 printLine
final
logLineBreak String
final
logPrint → void Function(Object object)
Log printer; defaults logPrint log to console. In flutter, you'd better use debugPrint. you can also write log in a file.
final
maxWidth int?
Width size per logPrint limit data value (base64 image, ...) print maxLength
final
prettyJson bool
Pretty print json/map/list payloads with indentation.
final
reqExtra String? Function(RequestOptions req)?
final
request bool
Print request Options
final
requestBody bool
Print request data Options.data
final
requestHeader bool
Print request header Options.headers
final
responseBody bool
Print Response.data
final
responseHeader bool
Print Response.headers
final
rspExtra String? Function(Response rsp)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

genByJson(dynamic input) String
返回json Str, 但是截取value的最大长度 maxWidth input 可能为 null
genLine([String pre = '', String suf = '╝']) String
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 hdl) → void
Called when the response is about to be resolved.
printBoxed({String? header, String? text, bool printEnd = false, bool buffOnly = false}) StringBuffer?
printEnd: 如果打印rsp同时又打印rspBody, 那么rsp无需 printEnd 分割线
printLine([String pre = '', String suf = '╝']) → void
printMapAsTable(Map? map, {String? header, bool printEnd = false, bool buffOnly = false}) StringBuffer?
改写为一行打印
printRequestHeader(RequestOptions options, {bool buffOnly = false}) StringBuffer?
printResponseHeader(Response response, int responseTime, {bool buffOnly = false}) StringBuffer?
printTextBlock(String? text, {String? header, bool printEnd = false, bool buffOnly = false}) StringBuffer?
toString() String
A string representation of this object.
inherited

Operators

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

Constants

chunkSize → const int
Size in which the Uint8List will be split
kInitialTab → const int
InitialTab count to logPrint json response
tabStep → const String
1 tab length