RUST_LOG vs RUSTC_LOG

I’m wary of this solution for a few reasons.

First, rustc is not the only tool in the toolchain. There’s at least cargo, rustup (it doesn’t use RUST_LOG now but I want it to), and rustdoc to consider. If you do a blanket RUST_LOG specification you’re going to get cargo output as well.

Second, it is anti-dogfooding. Rust logging was developed for all Rust crates to use, including rustc. If it is not serving that purpose well, then something is wrong. The log crate has facilities for controlling which things it is outputting, and maybe they are insufficient. Having rustc ditch the standard logging technique is papering over the problem. I doubt we would encourage all programs that find themselves in this situation to define their own logging variable. Are we going to have a CARGO_LOG, a RUSTUP_LOG?

3 Likes