We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
console_logger()
RUSTUP_TERM_COLOR
NO_COLOR
1 parent 509714d commit 67d6be2Copy full SHA for 67d6be2
src/cli/log.rs
@@ -64,7 +64,13 @@ fn console_logger<S>(process: Process) -> impl Layer<S>
64
where
65
S: Subscriber + for<'span> LookupSpan<'span>,
66
{
67
- let has_ansi = process.stderr().is_a_tty();
+ let has_ansi = match process.var("RUSTUP_TERM_COLOR") {
68
+ Ok(s) if s.eq_ignore_ascii_case("always") => true,
69
+ Ok(s) if s.eq_ignore_ascii_case("never") => false,
70
+ // `RUSTUP_TERM_COLOR` is prioritized over `NO_COLOR`.
71
+ _ if process.var("NO_COLOR").is_ok() => false,
72
+ _ => process.stderr().is_a_tty(),
73
+ };
74
let maybe_rust_log_directives = process.var("RUST_LOG");
75
let logger = tracing_subscriber::fmt::layer()
76
.with_writer(move || process.stderr())
0 commit comments