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:
envwhen it holds a non-blank value, elsedefault_levellowercased (e.g. “warn”). A blankRUST_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(ordefault_levelwhen it is unset or blank). Safe to call more than once; later calls are silently ignored.