PrettyDohLogger class
Credits to https://github.com/Milad-Akarie/pretty_dio_logger for providing such a comprehensive logger A pretty logger for DoH API Client it will print request/response info with a pretty format
- Implemented types
Constructors
- PrettyDohLogger.new({bool request = true, bool requestHeader = false, bool requestBody = true, bool responseBody = true, bool error = true, int maxWidth = 90, bool compact = true, void logPrint(String, {Object? error, int level, String name, int? sequenceNumber, StackTrace? stackTrace, DateTime? time, Zone? zone}) = log, bool enabled = true})
- Default constructor
Properties
- compact → bool
-
Print compact json response
final
- enabled → bool
-
Enable logger
final
- error → bool
-
Print error message
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logPrint → void Function(String, {Object? error, int level, String name, int? sequenceNumber, StackTrace? stackTrace, DateTime? time, Zone? zone})
-
Log printer; defaults print log to console.
In flutter, you'd better use debugPrint.
final
- maxWidth → int
-
Width size per print
final
- request → bool
-
Print request info
final
- requestBody → bool
-
Print request body
final
- requestHeader → bool
-
Print request header
final
- responseBody → bool
-
Print response body
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
String method, String url, dynamic error) → void -
Called when an error occurs
override
-
onRequest(
String method, String url, Map< String, dynamic> headers, [String? body, String? dohProvider]) → void -
Called before the request is sent
override
-
onResponse(
String method, String url, DohResponse response) → void -
Called after the response is received
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited