Skip to content

Commit

Permalink
Rollup merge of rust-lang#80901 - jyn514:better-colors, r=Mark-Simula…
Browse files Browse the repository at this point in the history
…crum

Make `x.py --color always` apply to logging too

Follow-up to rust-lang#78548, rust-lang#79004.

r? ```@Mark-Simulacrum```
  • Loading branch information
m-ou-se authored Jan 16, 2021
2 parents 5702cfa + 04b6036 commit 5b5aa10
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,22 @@ impl<'a> Builder<'a> {
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
}
Expand Down

0 comments on commit 5b5aa10

Please sign in to comment.