Skip to content

Commit

Permalink
docs(example): updates logging examples
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingAleCR committed Jul 8, 2023
1 parent adf0495 commit f7f9649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ class LoggerInterceptor extends InterceptorContract {
Future<BaseResponse> interceptResponse({
required BaseResponse response,
}) async {
print('----- Response -----');
print('Code: ${response.statusCode}');
print((response as Response).body);
log('----- Response -----');
log('Code: ${response.statusCode}');
if (response is Response) {
log((response).body);
}
return response;
}
}
Expand Down
4 changes: 3 additions & 1 deletion example/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class LoggerInterceptor extends InterceptorContract {
}) async {
log('----- Response -----');
log('Code: ${response.statusCode}');
log((response as Response).body);
if (response is Response) {
log((response).body);
}
return response;
}
}

0 comments on commit f7f9649

Please sign in to comment.