Skip to content
pubscout

flutter_pretty_dio_logger

3.0.0, released 4 years ago by an unverified publisher

A Dio interceptor that logs formatted JSON and cUrl commands.

WASM-ready
$ flutter pub add flutter_pretty_dio_logger
Source repository

What it does

It logs Dio HTTP requests, responses, errors, headers, query parameters, and processing times. It also generates and prints corresponding cUrl commands for easy copying and debugging.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using Dio for networking and need pretty-printed JSON logs in your console
  • You need to quickly copy and paste HTTP requests as cUrl commands for testing

Skip it when

  • You are not using Dio
  • You need a general-purpose logger that is not tied to HTTP interceptors

Strengths

  • Formats JSON and prints cUrl commands correctly
  • Supports FormData and various content types
  • Easy to configure as a standard Dio interceptor

Weaknesses

  • Limited only to Dio network logging
  • Lacks advanced error reporting integrations like Sentry out of the box

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Not documented

Dio dio = Dio();
dio.interceptors.add(
  PrettyDioLogger(
    requestHeader: true,
    queryParameters: true,
    requestBody: true,
    responseHeader: true,
    responseBody: true,
    error: true,
    showProcessingTime: true,
    showCUrl: true,
  ),
);

Alternatives

Packages that do the same job and could replace flutter_pretty_dio_logger.

  • pretty_dio_logger

    It is the package that inspired this one and serves the same purpose of logging Dio requests.

  • talker

    If you want a more comprehensive logging and debugging ecosystem with a UI.

  • logger

    If you need a general-purpose application logger rather than specifically an HTTP interceptor.

Works with

Packages commonly used together with flutter_pretty_dio_logger: ones it builds on, ones built on it, and its own family.