pretty_dio_logger 1.4.0 copy "pretty_dio_logger: ^1.4.0" to clipboard
pretty_dio_logger: ^1.4.0 copied to clipboard

Pretty Dio logger is a Dio interceptor that logs network calls in a pretty, easy to read format.

pretty_dio_logger #

Pub

Pretty Dio logger is a Dio interceptor that logs network calls in a pretty, easy to read format.

Usage #

Simply add PrettyDioLogger to your dio interceptors.

Dio dio = Dio();
dio.interceptors.add(PrettyDioLogger());

// customization
   dio.interceptors.add(PrettyDioLogger(
        requestHeader: true,
        requestBody: true,
        responseBody: true,
        responseHeader: false,
        error: true,
        compact: true,
        maxWidth: 90,
        enabled: kDebugMode,
        filter: (options, args){
            // don't print requests with uris containing '/posts' 
            if(options.path.contains('/posts')){
              return false;
            }
            // don't print responses with unit8 list data
            return !args.isResponse || !args.hasUint8ListData;
          }
      )
    );

How it looks like #

VS Code #

Request Example Error Example

Android studio #

Response Example

693
likes
160
pub points
99%
popularity

Publisher

verified publishercodeness.ly

Pretty Dio logger is a Dio interceptor that logs network calls in a pretty, easy to read format.

Repository (GitHub)
View/report issues

Topics

#dio #logging

Documentation

API reference

License

MIT (license)

Dependencies

dio

More

Packages that depend on pretty_dio_logger