-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustc should use a variable other than RUST_LOG for env_logger. #57985
Comments
Does |
Yes and no. It solves part of the problem in that it would remove the At the end of the day, this issue is mostly about expectations. As mentioned, there are hoops you can already jump through to mitigate this somewhat by specifying module restrictions. There's just an unfortunate conflation of application interface and tooling interface here that leads to surprising results, so that's what I was hoping to mitigate if possible. |
nominating for discussion at future T-compiler meeting (probably post all-hands, i.e. not for another two weeks). |
I think we could rename it to |
Yeah, that makes sense to me. It probably makes sense for |
triage: P-medium, E-needs-mentor. Leaving nomination tag to try to ensure we discuss at T-compiler meeting in near future. |
discussed at T-compiler meeting. no one present objected to the idea of each tool using its own specialized so we (informally at least) approve of this change and invite someone to post a PR for it. we do not believe this requires an RFC. |
Awesome, I'll look into doing a PR for this shortly, then. Thanks! |
(oh I should have removed nominated tag from this) |
For anyone who's interested in doing this issue, you'd just need to change this line: rust/src/librustc_driver/lib.rs Line 1166 in 258e3b3
to instead call |
Rename `RUST_LOG` to `RUSTC_LOG` cc: rust-lang#57985 I think we should also change these submodules: - rustc-guide - Cargo (rename to `CARGO_LOG`, cc: rust-lang/cargo#6605) - miri - rls - rustfmt r? @davidtwco
Rename `RUST_LOG` to `RUSTC_LOG` cc: rust-lang#57985 I think we should also change these submodules: - rustc-guide - Cargo (rename to `CARGO_LOG`, cc: rust-lang/cargo#6605, rust-lang/cargo#6189) - miri - rls - rustfmt r? @davidtwco
Closing as this was fixed in #60401. cc @rust-lang/compiler so that everyone is aware the variable has changed. |
This is related to Cargo Issue #6189.
In short, users generally don't expect tools to dump their debug output using the same mechanism their library or application uses to dump its debug output. As a user, when I do:
RUST_LOG=debug cargo run
I very much do not expect to be inundated with parse trees and such from
cargo
andrustc
. This isn't a fabricated issue--I watched this confusion happen to numerous people in independent settings. While this can be mitigated by filtering yourRUST_LOG
by module, there's no obvious way to say "I want everything from my application and its dependencies, but nothing from the tooling."I initially proposed fixing this for
cargo
by using aCARGO_LOG
environment variable in Cargo PR #6605, but @alexcrichton rightly pointed out that that's only a partial solution to the problem and that to really get the behavior I want, we'd need to make a similar change at least torustc
, potentially sharing a new variable. (RUST_INTERNAL_LOG
? Lots of bikeshedding possibilities here.)To start determining if this is even feasible, I need to answer a few questions:
RUST_LOG
environment variable considered part of the stable interface forrustc
? Is changing this even a possibility, putting aside whether it's desired?Thank you in advance for any consideration and input.
The text was updated successfully, but these errors were encountered: