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.

example/main.dart

import 'package:dio/dio.dart';
import 'package:pretty_dio_logger/src/pretty_dio_logger.dart';

void main() async {
  final dio = Dio()
    ..interceptors.add(
      PrettyDioLogger(
        requestHeader: true,
        requestBody: true,
        filter: (options, args) {
          //  return !options.uri.path.contains('posts');
          return !args.isResponse || !args.hasUint8ListData;
        },
      ),
    );
  try {
    await dio.get('https://jsonplaceholder.typicode.com/posts/1');
  } catch (e) {
    print(e);
  }
}
710
likes
160
points
299k
downloads

Publisher

verified publishercodeness.ly

Weekly Downloads

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