Skip to content

Commit

Permalink
Make LogInterceptor constant
Browse files Browse the repository at this point in the history
  • Loading branch information
bambinoua committed Feb 6, 2025
1 parent 20b3db3 commit 8b56fc7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dio/lib/src/interceptors/log.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import '../response.dart';
/// );
/// ```
class LogInterceptor extends Interceptor {
LogInterceptor({
const LogInterceptor({
this.request = true,
this.requestHeader = true,
this.requestBody = false,
Expand All @@ -31,22 +31,22 @@ class LogInterceptor extends Interceptor {
});

/// Print request [Options]
bool request;
final bool request;

/// Print request header [Options.headers]
bool requestHeader;
final bool requestHeader;

/// Print request data [Options.data]
bool requestBody;
final bool requestBody;

/// Print [Response.data]
bool responseBody;
final bool responseBody;

/// Print [Response.headers]
bool responseHeader;
final bool responseHeader;

/// Print error message
bool error;
final bool error;

/// Log printer; defaults print log to console.
/// In flutter, you'd better use debugPrint.
Expand All @@ -58,7 +58,7 @@ class LogInterceptor extends Interceptor {
/// ...
/// await sink.close();
/// ```
void Function(Object object) logPrint;
final void Function(Object object) logPrint;

@override
void onRequest(
Expand Down

0 comments on commit 8b56fc7

Please sign in to comment.