mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
fix(log): enable ansi color only in terminal
This commit is contained in:
parent
18f2b46f28
commit
c07043b7cf
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user