-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Changed RUST_LOG usage to CARGO_LOG to avoid confusion. #6605
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I am very in faver! |
Thanks for this again! I think though that we'll want to coordinate with rustc on this as well, as Cargo isn't the only consumer of Would you be willing to coordinate with at least |
That's a really good point, and one I should have considered, because you're right that this is only part of the story. As far as I can tell, That initially made me wonder if I'm thinking about this whole problem backwards and should just say, "If you don't like this behavior, then have your application use a different environment variable." But that ignores that libraries your application uses might also use All of that said, it's probably worth at least exploring options with |
Ok good to know about rustup! I think yeah opening an issue or a PR on the compiler is a good next step, and once there's consensus there if it's to change we can merge this too! |
I personally have gotten confused by cargo's logging and have never seen rustc logging. That may be because I'm mostly working on cargo. But it is also what I observed at RBR, and we observed a fair bit of confusion over this at RBR. I like consistency, but am not entirely convinced that the two necessarily need to be connected. |
I do tend to agree. It seems like it's unlikely that if both Ultimately, I think this change can be considered independently of the |
I feel that if we changed Cargo and not rustc it wouldn't really solve the original problem, while rustc can be avoided sometimes because we don't always run rustc, it can be surprising for folks to run with |
Maybe instead of trying to play "ignore the convention" we should have another way of specifying environment variables to the binaries run or tested by |
I feel like that's actually just another workaround for the 'problem'. The core of the matter (for me) is a 'principle of least surprise' sort of thing. As a user, if I learn about For me, because the need to see |
Except the env_logger that you just learned about or were recommended doesn't document to use
|
So, I want to stress something that may be lost in the discussion here: This isn't a hypothetical scenario I'm creating where these users are doing this. This whole change was inspired by actual events. At RBR, I watched basically a whole room of people in a workshop learn about The point I'm trying to make is that, documentation aside, these were just people using environment variables and If we don't think that's worth making this change, that's understandable. This obviously isn't vital in any sense. But it's a point of friction I saw in person that seemed easily corrected. |
☔ The latest upstream changes (presumably #6687) made this pull request unmergeable. Please resolve the merge conflicts. |
An example of someone complaining about this in the wild: |
☔ The latest upstream changes (presumably #6695) made this pull request unmergeable. Please resolve the merge conflicts. |
In Rustup we're considering moving from its custom notifications/term2 setup to more commonplace log + env_logger crates, which is relevant here. So I'm going to nominate this for discussion at next week's meeting. |
For reference, the rustc issue is: rust-lang/rust#57985 |
Yeah, haven't had time to work on the |
☔ The latest upstream changes (presumably #6832) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm gonna close this to help clear out our queue, but I believe the conclusion remains that we can add this at any time but we'll just want to make sure the rustc side lands first. |
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
Changed RUST_LOG usage to CARGO_LOG to avoid confusion. This is a repost of #6605 now that rust-lang/rust#60401 has been merged. This also includes a fix in `TargetInfo::new` to remove the **RUSTC_LOG** var.
Fixes #6189.
Changes Cargo to to initialize env_logger with the CARGO_LOG variable instead of RUST_LOG. Also updated documentation, tests, etc. to match the change.
This was previously discussed in PR #6190 but closed at the time due to the soft feature freeze pre-2018. Now that we're beyond that, it seemed worth bringing this up again since there otherwise seemed to generally be support for it.
This particular version also updates the change to change the pretty_env_logger variable as well.