Skip to content
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

Cargo should use a variable other than RUST_LOG for env_logger. #6189

Closed
zachlute opened this issue Oct 20, 2018 · 3 comments
Closed

Cargo should use a variable other than RUST_LOG for env_logger. #6189

zachlute opened this issue Oct 20, 2018 · 3 comments

Comments

@zachlute
Copy link
Contributor

Suggestion: CARGO_LOG.

This came up during the Debugging session at Rust Belt Rust. Basically, as soon as people set up their project to use env_logger and set RUST_LOG=debug, they were super confused by the crazy amount of seemingly-random output suddenly on their screen, which appeared to include parse tokens of some sort? The same problem exists at the info level, though obviously to a lesser extent.

While it makes sense for most things to just use RUST_LOG, and it's true that you can solve this problem by specifying a module filter for env_logger, it seems like a common and confusing enough behavior, and a likely enough case that somebody would do RUST_LOG=debug cargo run and get a whole bunch of confusing output, that it likely makes sense to just use a different variable for Cargo.

In fact, while working on a potential PR for this, it happened again to the guy sitting next to me. "What the heck is all this crazy output?" He wasn't a plant or anything!

The only potential downside here is if people expect RUST_LOG to work and it doesn't, but I suspect the number of workflows this would break is vanishingly small and it's a simple fix, so maybe that's not a big deal?

Anyway, PR coming shortly for feedback.

@dwijnand
Copy link
Member

Noting for the record (there's a backlink, but still): #6190 fixes this but was postponed to a later date.

Centril added a commit to Centril/rust that referenced this issue May 3, 2019
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
@JohnTitor
Copy link
Member

rust-lang/rust#60401 was merged

@ehuss
Copy link
Contributor

ehuss commented May 9, 2019

Fixed via #6918.

@ehuss ehuss closed this as completed May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants