You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm frustrated when I filter out a message, but its stack trace is not filtered out.
Describe the solution you'd like
When a message is filtered out, its stack trace should also be filtered out.
Describe alternatives you've considered
I've had to extend TalkerLogger to override log which I don't think is normal usage of this package.
Additional context
This is the print (generated by a code generation package) that I want filtered out:
debugPrintStack(
label:
'[${path ?? 'NickNameForm'}]\n┗━ Avoid calling `model` on invalid form. Possible exceptions for non-nullable fields which should be guarded by `required` validator.');
this is what I had to do to filter it out completely:
// We had to extend TalkerLogger due to the message we wanted to filter
// occurring over a large amount of messages due to the stack trace being split
//into multiple subsequent messages.
class CustomTalkerLogger extends TalkerLogger {
bool _ignoreNextStackTrace = false;
CustomTalkerLogger({
super.settings,
LoggerFormatter? formatter,
LoggerFilter? filter,
super.output,
}) : super(
formatter: formatter ?? const ExtendedLoggerFormatter(),
filter: filter ?? LogLevelFilter(settings?.level ?? LogLevel.debug),
);
@override
CustomTalkerLogger copyWith({
TalkerLoggerSettings? settings,
LoggerFormatter? formatter,
LoggerFilter? filter,
Function(String message)? output,
}) {
return CustomTalkerLogger(
settings: settings ?? this.settings,
formatter: formatter ?? this.formatter,
filter: filter ?? LogLevelFilter(settings?.level ?? LogLevel.debug),
output: output ?? log_output.outputLog,
);
}
@override
void log(msg, {LogLevel? level, AnsiPen? pen}) {
if (msg.toString().contains('Avoid calling `model` on invalid form')) {
_ignoreNextStackTrace = true;
return;
}
if (_ignoreNextStackTrace) {
if (level == LogLevel.debug && msg.toString().startsWith('#')) {
return;
} else {
_ignoreNextStackTrace = false;
}
}
super.log($msg, level: level, pen: pen);
}
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm frustrated when I filter out a message, but its stack trace is not filtered out.
Describe the solution you'd like
When a message is filtered out, its stack trace should also be filtered out.
Describe alternatives you've considered
I've had to extend TalkerLogger to override
log
which I don't think is normal usage of this package.Additional context
This is the print (generated by a code generation package) that I want filtered out:
this is what I had to do to filter it out completely:
The text was updated successfully, but these errors were encountered: