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);
  }
}
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