PSA: RUST_LOG for rustc got renamed to RUSTC_LOG

#1

In the hope that y’all don’t have to waste as much time on this as I did: when working on the compiler, RUST_LOG recently got renamed to RUSTC_LOG without any deprecation warning or compatibility layer in place (that I could find).

I guess technically this is not a breaking change, but it can be quite baffling when you do the thing that always worked and suddenly it doesn’t work any more. :wink:

8 Likes
#2

To clarify, this is about logging inside the compiler itself. The env_logger default is still RUST_LOG, so this won’t break your workflow unless you are hacking on the compiler itself.

#3

Oh, I didn’t even know RUST_LOG is also used outside the compiler. :wink: Thanks for clarifying!

1 Like
#4

Yeah, that was the motivation for the change: everyone uses RUST_LOG, and doing something like env RUST_LOG=debug cargo run my-app used to produce a ton of output from rustc/Cargo, with your app’s logging in the end.

7 Likes
#5

The same change has been done to CARGO_LOG.

4 Likes