0 purchases
color observer logger
Color logger #
More examples you can get here
Work with vscode extension for help
Vscode extension flutter logger easy life
without extension
with extension you can tap absolute path to code line
Setup Observer bloc
more
// show stack trace
// if use 'flutter build apk --obfuscate
// set stackTracking = false ;
//AnsiColor.showColor();
Logger.root.level = Level.ALL;
Bloc.observer = ColorBlocObserver(
stackTracking: true,
kIsWeb: kIsWeb,
filter: ShowWhenFilter(
[
"TestLoginBloc",
"TestCubit",
],
),
blocColor: AnsiColor.fg(40),
methodCount: 3,
blocHighLightFilter: DefaultHighLightFilter(
color: AnsiColor.fg(214),
colorOnly: false,
),
);
copied to clipboard
Logger filter
more
Trigger when string contains
class ShowWhenFilter extends Filter {
ShowWhenFilter(List<String> name) : super(name);
}
class HideWhenFilter extends Filter {
HideWhenFilter(List<String> name) : super(name);
}
copied to clipboard
HighLightFilter #
more
Highlight message with color when filter return true
class DefaultHighLightFilter extends BlocHighLightFilter {
@override
bool filter(String message) {
return message.toLowerCase().contains('error') ||
message.toLowerCase().contains('fail') ||
message.toLowerCase().contains('exception');
}
}
copied to clipboard
bloc
untrack
track
error
error track
cubit
untrack
track
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.