Skip to content

Commit

Permalink
Auto merge of #12488 - weihanglo:ansi-color-log, r=weihanglo
Browse files Browse the repository at this point in the history
fix(log): enable ansi color only in terminal
  • Loading branch information
bors committed Aug 14, 2023
2 parents 0067476 + c07043b commit c3136a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/xtask-bump-check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn setup_logger() {
let env = tracing_subscriber::EnvFilter::from_env("CARGO_LOG");

tracing_subscriber::fmt()
.with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr()))
.with_writer(std::io::stderr)
.with_env_filter(env)
.init();
Expand Down
1 change: 1 addition & 0 deletions src/bin/cargo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn setup_logger() {
let env = tracing_subscriber::EnvFilter::from_env("CARGO_LOG");

tracing_subscriber::fmt()
.with_ansi(std::io::IsTerminal::is_terminal(&std::io::stderr()))
.with_writer(std::io::stderr)
.with_env_filter(env)
.init();
Expand Down

0 comments on commit c3136a8

Please sign in to comment.