Skip to content

Commit f137594

Browse files
committed
Auto merge of #12488 - weihanglo:ansi-color-log, r=epage
fix(log): enable ansi color only in terminal
2 parents 0067476 + c07043b commit f137594

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

crates/xtask-bump-check/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn setup_logger() {
2020
let env = tracing_subscriber::EnvFilter::from_env("CARGO_LOG");
2121

2222
tracing_subscriber::fmt()
23+
.with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr()))
2324
.with_writer(std::io::stderr)
2425
.with_env_filter(env)
2526
.init();

src/bin/cargo/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn setup_logger() {
4141
let env = tracing_subscriber::EnvFilter::from_env("CARGO_LOG");
4242

4343
tracing_subscriber::fmt()
44+
.with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr()))
4445
.with_writer(std::io::stderr)
4546
.with_env_filter(env)
4647
.init();

0 commit comments

Comments
 (0)