Logger class

Logger interface to log out request and response data on console. Use this class as a parameter of HttpWithMiddleware or HttpClientWithMiddleware such as

HttpWithMiddleware http = HttpWithMiddleware.build(middlewares: [
    HttpLogger(logLevel: LogLevel.BODY),
]);```
or
```dart
HttpClientWithMiddleware http = HttpClientWithMiddleware.build(middlewares: [
    HttpLogger(logLevel: LogLevel.BODY),
]);

To see different types of Log level and their use cases, please see the documentation of Logger.

Constructors

Logger({required LogLevel logLevel, int maxWidth = 90, bool compact = true})

Properties

compact bool
whether the print will be compact or not, defaults to true
final
hashCode int
The hash code for this object.
no setterinherited
logLevel LogLevel
final
logPrint ↔ void Function(Object object)
getter/setter pair
maxWidth int
percentage of width the logger takes to print, defaults to 90
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

logError(dynamic error) → void
logRequest(RequestData data) → void
logResponse(ResponseData data) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

decoder JsonDecoder
getter/setter pair
encoder JsonEncoder
getter/setter pair

Static Methods

prettyPrintJson(String? input) → void

Constants

chunkSize → const int
Size in which the Uint8List will be splitted
initialTab → const int
tabStep → const String