Skip to content

Commit

Permalink
add simple default initialization for the PrintAppender
Browse files Browse the repository at this point in the history
  • Loading branch information
zoechigist committed Apr 25, 2016
1 parent 46d8c03 commit b937381
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions .analysis_options
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ linter:
- avoid_init_to_null
- avoid_empty_else
- avoid_return_types_on_setters
- await_only_future
- camel_case_types
- constant_identifier_names
- empty_constructor_bodies
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.1

- add simple default initialization for the `PrintAppender` with `setup_print_appender.dart`

## 0.1.0

- remove Polymer component and dependency
Expand Down
16 changes: 16 additions & 0 deletions lib/setup_print_appender.dart
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);
}
10 changes: 5 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.10.0"
barback:
description:
name: barback
Expand All @@ -42,7 +42,7 @@ packages:
name: bwu_grinder_tasks
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1-dev.2"
version: "0.1.1-dev.3"
charcode:
description:
name: charcode
Expand Down Expand Up @@ -72,7 +72,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
csslib:
description:
name: csslib
Expand Down Expand Up @@ -114,7 +114,7 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.7"
version: "0.12.7+1"
logging:
description:
name: logging
Expand Down Expand Up @@ -295,4 +295,4 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.8"
sdk: ">=1.14.0 <1.17.0"
sdk: ">=1.16.0-dev.5.0 <1.17.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bwu_log
version: 0.1.0
version: 0.1.1
authors:
- Günter Zöchbauer <guenter@gzoechbauer.com>
- Adam Bender <bendera@google.com>
Expand Down

0 comments on commit b937381

Please sign in to comment.