EffDioLogger class
Constructors
-
EffDioLogger({bool request = true, bool requestBody = true, bool responseBody = true, bool error = true, bool filter(RequestOptions options, FilterArgs args)?, int lineWidth = 162, bool compact = true, int? maxWidth = 324, void logPrint(Object object)?, String logLineBreak = '\n', bool enabled = true, })
-
-
EffDioLogger.compat({bool request = true, bool requestBody = false, bool responseBody = true, bool error = true, bool filter(RequestOptions options, FilterArgs args)?, int lineWidth = 162, int? maxWidth = 324, bool compact = true, void logPrint(Object object)?, String logLineBreak = '\n', bool enabled = true, })
-
兼容 EfficientDioLogger 默认构造的输出行为.
Properties
-
compact
→ bool
-
Print compact json response
final
-
enabled
→ bool
-
Enable logPrint
final
-
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
-
final
-
request
→ bool
-
Print request
Options
final
-
requestBody
→ bool
-
Print request data
Options.data
final
-
Print request header
Options.headers
final
-
responseBody
→ bool
-
Print
Response.data
final
-
Print
Response.headers
final
-
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? text, bool printEnd = false, bool buffOnly = false})
→ StringBuffer?
-
printEnd: 如果打印rsp同时又打印rspBody, 那么rsp无需 printEnd 分割线
-
printLine([String pre = '', String suf = '╝'])
→ void
-
-
printMapAsTable(Map? map, {bool printEnd = false, bool buffOnly = false})
→ StringBuffer?
-
改写为一行打印
-
-
-
printTextBlock(String? text, {bool printEnd = false, bool buffOnly = false})
→ StringBuffer?
-
-
toString()
→ String
-
A string representation of this object.
inherited