Skip to content

Commit ede725d

Browse files
yangsfangBungeefan
authored andcommitted
Allow switching out LogFilter globally
Fixes #33
1 parent 6e022cb commit ede725d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/logger.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class Logger {
5050
/// All logs with levels below this level will be omitted.
5151
static Level level = Level.verbose;
5252

53+
/// The current default implementation of log filter.
54+
static LogFilter defaultLogFilter = DevelopmentFilter();
55+
5356
static final Set<LogCallback> _logCallbacks = {};
5457

5558
static final Set<OutputCallback> _outputCallbacks = {};
@@ -69,7 +72,7 @@ class Logger {
6972
LogPrinter? printer,
7073
LogOutput? output,
7174
Level? level,
72-
}) : _filter = filter ?? DevelopmentFilter(),
75+
}) : _filter = filter ?? defaultLogFilter,
7376
_printer = printer ?? PrettyPrinter(),
7477
_output = output ?? ConsoleOutput() {
7578
_filter.init();

0 commit comments

Comments
 (0)