Open polemius opened 4 months ago
searching through the code of the package i found that when defining talkerflutter is overrides the logger settings for the colors
this example will work
final logger = TalkerLogger(
settings: TalkerLoggerSettings(
colors: {
LogLevel.critical: AnsiPen()..red(),
LogLevel.error: AnsiPen()..magenta(),
LogLevel.info: AnsiPen()..red(),
},
enableColors: true,
),
output: (String message) {
if (kIsWeb) {
// ignore: avoid_print
print(message);
return;
}
if ([TargetPlatform.iOS, TargetPlatform.macOS]
.contains(defaultTargetPlatform)) {
log(message, name: 'Talker');
return;
}
debugPrint(message);
},
);
logger.info('test');
final talkerFlutter = TalkerFlutter.init(
logger: logger,
settings: TalkerSettings(colors: {
TalkerLogType.critical: AnsiPen()..red(),
TalkerLogType.error: AnsiPen()..magenta(),
TalkerLogType.info: AnsiPen()..red(),
}));
talkerFlutter.info('test');
as you can see the colors defined TalkerFlutter.init
will be used and the one on logger level will be ignored
Describe the bug I can't redifine colors for talker_flutter. It uses the default one only.
Code
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):