Skip to main content

Module logging

Module logging 

Source
Expand description

Shared tracing setup for the CLI, GUI, and guard daemon: logs go to stderr (so stdout stays script-clean), colored only when stderr is a terminal, filtered by RUST_LOG when set, else by a per-binary default.

Functions§

filter_spec
The env-filter directive string: env when it holds a non-blank value, else default_level lowercased (e.g. “warn”). A blank RUST_LOG="" is treated the same as unset, rather than as an empty (match-nothing) filter.
init
Install the global tracing subscriber. Writes to stderr, with ANSI colors only when stderr is a terminal, filtered by RUST_LOG (or default_level when it is unset or blank). Safe to call more than once; later calls are silently ignored.