Skip to content

Commit

Permalink
Merge pull request #88 from westito/86-fix-color-override-reset
Browse files Browse the repository at this point in the history
86 fix color override in dio and reset color in console
  • Loading branch information
Frezyx authored Dec 28, 2022
2 parents 9ce0359 + 9782cf3 commit 458e56a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/talker_dio_logger/lib/http_logs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class HttpRequestLog extends TalkerLog {
final TalkerDioLoggerSettings settings;

@override
AnsiPen get pen => settings.requestPen ?? AnsiPen()
..xterm(219);
AnsiPen get pen => settings.requestPen ?? (AnsiPen()
..xterm(219));

@override
String get title => 'http-request';
Expand Down Expand Up @@ -53,8 +53,8 @@ class HttpResponseLog extends TalkerLog {
final TalkerDioLoggerSettings settings;

@override
AnsiPen get pen => settings.responsePen ?? AnsiPen()
..xterm(46);
AnsiPen get pen => settings.responsePen ?? (AnsiPen()
..xterm(46));

@override
String get title => 'http-response';
Expand Down Expand Up @@ -96,8 +96,8 @@ class HttpErrorLog extends TalkerLog {
final TalkerDioLoggerSettings settings;

@override
AnsiPen get pen => settings.errorPen ?? AnsiPen()
..red();
AnsiPen get pen => settings.errorPen ?? (AnsiPen()
..red());

@override
String get title => 'http-error';
Expand Down
2 changes: 1 addition & 1 deletion packages/talker_logger/lib/src/talker_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TalkerLogger implements TalkerLoggerInterface {
void Function(String message)? output,
}) {
// ignore: avoid_print
_output = output ?? (String message) => print(message);
_output = output ?? (String message) => message.split('\n').forEach(print);
_filter = filter ?? LogLevelTalkerLoggerFilter(settings.level);
ansiColorDisabled = false;
}
Expand Down

0 comments on commit 458e56a

Please sign in to comment.