color_observer_logger

Creator: coderz1093

Last updated:

0 purchases

color_observer_logger Image
color_observer_logger Images

Languages

Categories

Add to Cart

Description:

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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.