mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
Make --color always apply to logging too
This commit is contained in:
@@ -814,12 +814,22 @@ pub fn cargo(
|
||||
cargo.env("REAL_LIBRARY_PATH", e);
|
||||
}
|
||||
|
||||
// Found with `rg "init_env_logger\("`. If anyone uses `init_env_logger`
|
||||
// from out of tree it shouldn't matter, since x.py is only used for
|
||||
// building in-tree.
|
||||
let color_logs = ["RUSTDOC_LOG_COLOR", "RUSTC_LOG_COLOR", "RUST_LOG_COLOR"];
|
||||
match self.build.config.color {
|
||||
Color::Always => {
|
||||
cargo.arg("--color=always");
|
||||
for log in &color_logs {
|
||||
cargo.env(log, "always");
|
||||
}
|
||||
}
|
||||
Color::Never => {
|
||||
cargo.arg("--color=never");
|
||||
for log in &color_logs {
|
||||
cargo.env(log, "never");
|
||||
}
|
||||
}
|
||||
Color::Auto => {} // nothing to do
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user