Skip to content

Commit e135965

Browse files
rockygeekzgurry
andauthored
fix: disable ANSI colors when output is redirected (#601)
Co-authored-by: Gurinder Singh <gurisingh@microsoft.com>
1 parent 43dc9ff commit e135965

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

crates/cargo-wdk/src/trace.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
//! - A function to map clap verbosity levels to corresponding cargo verbose
1010
//! flags.
1111
12+
use std::io::IsTerminal;
13+
1214
use tracing::level_filters::LevelFilter;
1315
use tracing_subscriber::EnvFilter;
1416

@@ -35,6 +37,7 @@ pub fn init_tracing(verbosity_level: clap_verbosity_flag::Verbosity) {
3537
.with_file(false)
3638
.with_writer(std::io::stderr)
3739
.with_env_filter(tracing_filter)
40+
.with_ansi(std::io::stderr().is_terminal())
3841
.init();
3942
}
4043

0 commit comments

Comments
 (0)