Skip to content

Log print messages at warning #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.12.7+4

- `print` calls inside a Builder will now log at warning instead of info.

## 0.12.7+3

- Throw when attempting to use a `BuildStep` after it has been completed.
Expand Down
6 changes: 3 additions & 3 deletions build/lib/src/builder/logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ Logger get log => Zone.current[logKey] as Logger ?? _default;

/// Runs [fn] in an error handling [Zone].
///
/// Any calls to [print] will be logged with `log.info`, and any errors will be
/// logged with `log.severe`.
/// Any calls to [print] will be logged with `log.warning`, and any errors will
/// be logged with `log.severe`.
///
/// Completes with the first error or result of `fn`, whichever comes first.
Future<T> scopeLogAsync<T>(Future<T> fn(), Logger log) {
var done = new Completer<T>();
runZoned(fn,
zoneSpecification:
new ZoneSpecification(print: (self, parent, zone, message) {
log.info(message);
log.warning(message);
}),
zoneValues: {logKey: log},
onError: (Object e, StackTrace s) {
Expand Down
2 changes: 1 addition & 1 deletion build/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
version: 0.12.7+3
version: 0.12.7+4
description: A build system for Dart.
author: Dart Team <[email protected]>
homepage: https://github.com/dart-lang/build/tree/master/build
Expand Down