Skip to content

Commit 3833fa0

Browse files
authored
Improve package:build API docs. (#4211)
1 parent 01da402 commit 3833fa0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

build/lib/src/logging.dart

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,24 @@ const Symbol logKey = #buildLog;
1010

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

13-
/// The log instance for the currently running BuildStep.
13+
/// `Logger` for use by a builder to log to the main `build_runner` output.
1414
///
15-
/// Will be `null` when not running within a build.
15+
/// `build_runner` distinguishes three categories of log record:
16+
///
17+
/// Below [Level.WARNING] is called "info".
18+
///
19+
/// Info is only shown if `--verbose` was explicitly requested on the command
20+
/// line.
21+
///
22+
/// At [Level.WARNING] but below [Level.SEVERE] is called a "warning".
23+
///
24+
/// Warnings are aways shown, and the final build status will indicate that
25+
/// the build completed with warnings.
26+
///
27+
/// At or above [Level.SEVERE] is an "error".
28+
///
29+
/// Errors signal that the build step has failed: build steps that depend on the
30+
/// outputs will not run, and the build status will say the build failed.
31+
///
32+
/// If a builder throws an exception then it is logged as an error.
1633
Logger get log => Zone.current[logKey] as Logger? ?? _default;

0 commit comments

Comments
 (0)