Reference · reference
log module
use log gives a script structured logging. Every message carries the context of the step that emitted it into the terminal output and the NDJSON file log. Raw print and println calls are redirected into log::info, so stdout stays clean for --json. shell::run_streaming in the shell module pipes a long command's output through this module live. All four functions are available on every platform and none of them fails.
debug, info, warn and error
rust
debug
info
warn
error
Each function emits one message at its level. The terminal shows messages at or above the verbosity selected with -v. The file log uses its own level, set with --log-level, so a debug message can reach the file without reaching the terminal.
| Function | Level | Typical use |
|---|---|---|
| debug | debug | values a script inspected while deciding |
| info | info | progress a reader wants to see |
| warn | warn | something unexpected that the step tolerated |
| error | error | a failure the step is about to report |
rust
use log
info
warn