Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Sep 28, 2023
1 parent edc6823 commit 308ab85
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions dio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,24 @@ dio.interceptors.add(LogInterceptor(responseBody: false)); // Do not output resp
**Note:** When using the default `logPrint` function, logs will only be printed
in DEBUG mode (when the assertion is enabled).


Alternatively `dart:developer`'s log can also be used to log messages.
Alternatively `dart:developer`'s log can also be used to log messages (available in Flutter too).

#### Flutter

When using Flutter, Flutters own `debugPrint` function should be used.

This ensures, that debug messages are also available via `flutter logs`.

**Note:** `debugPrint` **does not mean print logs under the DEBUG mode**,
it's a throttled function which helps to print full logs without truncation.
Do not use it under any production environment unless you're intended to.

```dart
dio.interceptors.add(LogInterceptor(logPrint: (o) => debugPrint(o.toString())));
dio.interceptors.add(
LogInterceptor(
logPrint: (o) => debugPrint(o.toString()),
),
);
```

#### Custom Interceptor
Expand Down

0 comments on commit 308ab85

Please sign in to comment.