diff --git a/crates/puffin-cli/src/logging.rs b/crates/puffin-cli/src/logging.rs index 5a69e4a83..478e01c0b 100644 --- a/crates/puffin-cli/src/logging.rs +++ b/crates/puffin-cli/src/logging.rs @@ -1,3 +1,4 @@ +use std::io::IsTerminal; use tracing::level_filters::LevelFilter; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; @@ -21,6 +22,10 @@ pub(crate) enum Level { /// environment variable) along with the formatting of the output. For example, [`Level::Verbose`] /// includes targets and timestamps, along with all `puffin=debug` messages by default. pub(crate) fn setup_logging(level: Level) { + if !std::io::stderr().is_terminal() { + colored::control::set_override(false); + } + match level { Level::Default => { // Show nothing, but allow `RUST_LOG` to override.