Skip to content
Merged
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
21 changes: 19 additions & 2 deletions build/lib/src/logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ const Symbol logKey = #buildLog;

final _default = Logger('build.fallback');

/// The log instance for the currently running BuildStep.
/// `Logger` for use by a builder to log to the main `build_runner` output.
///
/// Will be `null` when not running within a build.
/// `build_runner` distinguishes three categories of log record:
///
/// Below [Level.WARNING] is called "info".
///
/// Info is only shown if `--verbose` was explicitly requested on the command
/// line.
///
/// At [Level.WARNING] but below [Level.SEVERE] is called a "warning".
///
/// Warnings are aways shown, and the final build status will indicate that

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you have a choice about showing infos but warnings are always shown.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was not my point. My point was that it should say "always" not "aways".

/// the build completed with warnings.
///
/// At or above [Level.SEVERE] is an "error".
///
/// Errors signal that the build step has failed: build steps that depend on the
/// outputs will not run, and the build status will say the build failed.
///
/// If a builder throws an exception then it is logged as an error.
Logger get log => Zone.current[logKey] as Logger? ?? _default;
Loading