Milad-Akarie / pretty_dio_logger

MIT License
238 stars 53 forks source link

add customizable color coding for log prints #47

Open Mohamed-7018 opened 2 months ago

Mohamed-7018 commented 2 months ago

As shown in the image image

image

image

Code Used:

 // Adding PrettyDioLogger with specific options
    dio.interceptors.add(
      PrettyDioLogger(
        responseBody: true, // Log response body
        error: true, // Log errors
        requestHeader: true, // Do not log request headers
        responseHeader: true, // Do not log response headers
        request: true, // Log request details
        requestBody: true, // Log request body
        defaultColor: PrettyDioLoggerColors.cyan,
        errorColor: PrettyDioLoggerColors.red,
        requestColor: PrettyDioLoggerColors.green,
        responseColor: PrettyDioLoggerColors.magenta,
        headerColor: PrettyDioLoggerColors.yellow,
        responseHeaderColor: PrettyDioLoggerColors.red,
        responseStatusColor: PrettyDioLoggerColors.blue,
      ),
    );