Skip to main content

apply_rust_log

Function apply_rust_log 

Source
pub fn apply_rust_log(base: Targets) -> Targets
Expand description

Replace base with RUST_LOG’s filter when that variable is set and non-empty.

A spec that does not parse is reported on stderr and base is kept. RUST_LOG belongs to the ecosystem, not to us — plenty of crates read it, and a value we reject may be aimed at one of them — so an unusable value degrades the host to its own default rather than killing the process or silencing it. Both hosts in this workspace use this, so RUST_LOG=<garbage> means the same thing to the CLI and to an AOT binary.