pretty_dio_clean_logger 1.0.2 copy "pretty_dio_clean_logger: ^1.0.2" to clipboard
pretty_dio_clean_logger: ^1.0.2 copied to clipboard

A clean and customizable Dio logger that prints beautifully formatted request, response, and error logs with filtering support.

example/main.dart

import 'package:dio/dio.dart';
import 'package:pretty_dio_clean_logger/pretty_dio_clean_logger.dart';

void main() async {
  final dio = Dio()
    ..interceptors.add(
      PrettyDioCleanLogger(
        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);
  }
}
5
likes
150
points
218
downloads

Documentation

API reference

Publisher

verified publisherraihansikdar.com

Weekly Downloads

A clean and customizable Dio logger that prints beautifully formatted request, response, and error logs with filtering support.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter

More

Packages that depend on pretty_dio_clean_logger