Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add customizable color coding for log prints #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mohamed-7018
Copy link

  • Introduced color options for request, header, body, error, response, response headers, and response status
  • Users can now customize the color of each log type (request, response, error, etc.)
  • Added a default fallback color to handle general log cases
  • Enhances readability by allowing color differentiation between different log types

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

- Introduced color options for request, header, body, error, response, response headers, and response status
- Users can now customize the color of each log type (request, response, error, etc.)
- Added a default fallback color to handle general log cases
- Enhances readability by allowing color differentiation between different log types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant