forked from google/quiver-log
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple default initialization for the
PrintAppender
- Loading branch information
1 parent
46d8c03
commit b937381
Showing
5 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
library bwu_log.setup_print_appender; | ||
|
||
import 'package:bwu_log/bwu_log.dart' show basicLogFormatter, PrintAppender; | ||
import 'package:logging/logging.dart' | ||
show hierarchicalLoggingEnabled, Logger, Level; | ||
|
||
export 'package:logging/logging.dart' show Logger, Level; | ||
|
||
void initLogging([Level loggingLevel]) { | ||
hierarchicalLoggingEnabled = true; | ||
|
||
Logger.root.level = loggingLevel ?? Level.SEVERE; | ||
|
||
final PrintAppender appender = new PrintAppender(basicLogFormatter); | ||
appender.attachLogger(Logger.root); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters