Custom colors are not applying for the TalkerScreen. v4.3.4
Colors are not applying, and TalkerScreen shows default colors. Btw custom titles working fine
talker = TalkerFlutter.init(
settings: TalkerSettings(
useConsoleLogs: false,
colors: {
TalkerLogType.critical: AnsiPen()..red(),
TalkerLogType.error: AnsiPen()..red(),
TalkerLogType.exception: AnsiPen()..red(),
TalkerLogType.warning: AnsiPen()..red(),
TalkerLogType.info: AnsiPen()..red(),
TalkerLogType.debug: AnsiPen()..red(),
TalkerLogType.verbose: AnsiPen()..red(),
},
),
);
class FirestoreReadsLog extends TalkerLog {
FirestoreReadsLog(String super.message);
@override
String get title => 'firestore reads';
@override
AnsiPen get pen => AnsiPen()..red();
}
class NavigationLog extends TalkerLog {
NavigationLog(String super.message);
@override
String get title => 'navigation';
@override
AnsiPen get pen => AnsiPen()..red();
}
class JsonLog extends TalkerLog {
JsonLog(String super.message);
@override
String get title => 'json';
@override
AnsiPen get pen => AnsiPen()..red();
}
Documentation is unclear. This code is changing colors in the debug console:
talker = TalkerFlutter.init(
settings: TalkerSettings(
colors: {
TalkerLogType.critical: AnsiPen()..xterm(160),
TalkerLogType.exception: AnsiPen()..xterm(160),
TalkerLogType.error: AnsiPen()..xterm(160),
TalkerLogType.warning: AnsiPen()..xterm(208),
TalkerLogType.info: AnsiPen()..xterm(39),
TalkerLogType.debug: AnsiPen()..xterm(40),
TalkerLogType.verbose: AnsiPen()..xterm(8),
},
),
);
and this code in Talker Screen.
builder: (context, state) => TalkerScreen(
appBarTitle: 'FamilyHub Logs',
talker: FamilyHubLogger.instance.talker,
theme: const TalkerScreenTheme(
logColors: {
TalkerLogType.critical: Colors.red,
TalkerLogType.exception: Colors.red,
TalkerLogType.error: Colors.red,
TalkerLogType.warning: Colors.orange,
TalkerLogType.info: Colors.blue,
TalkerLogType.debug: Colors.green,
TalkerLogType.verbose: Colors.grey,
},
),
),
anyway I cannot change colors for my custom Log Types, because it work only for the debug console, I can only override LogLevel
@booooohdan Yes, you're right! This section of the documentation could be improved.
Customization of colors, titles, and so on have been updated and documentation has been updated in this PR:
https://github.com/Frezyx/talker/pull/272
Hello @booooohdan ! We have fixed this issue in this PR https://github.com/Frezyx/talker/pull/272 This fixes available in 4.5.0 package version