Skip to main content

init_cli_tracing

Function init_cli_tracing 

Source
pub fn init_cli_tracing(verbose: u8, quiet: bool, json: bool)
Expand description

Initializes the tracing subscriber for the cortex CLI. Like init_tracing (stderr, RUST_LOG-filtered, idempotent), but when RUST_LOG is unset the level is driven by the CLI’s -v/-q flags rather than defaulting to info:

flagslevel
-qerror
(none)warn
-vinfo
-vvdebug
-vvv+trace

The default is warn (not info) because the CLI’s normal output is each subcommand’s own stdout / --json; tracing events are opt-in diagnostics. Events always go to stderr so they never corrupt a --json subcommand’s machine output on stdout. An explicit RUST_LOG always wins over the flags (so RUST_LOG=cortex=trace cortex status works regardless of -v).

json selects newline-delimited JSON events (--log-format json) for machine ingestion (the agent-facing log shape); the default is the human text formatter.