diff --git a/core/lib/Cargo.toml b/core/lib/Cargo.toml index 6f21b28914..838f1224ad 100644 --- a/core/lib/Cargo.toml +++ b/core/lib/Cargo.toml @@ -43,7 +43,7 @@ num_cpus = "1.0" time = { version = "0.3", features = ["macros", "parsing"] } memchr = "2" # TODO: Use pear instead. binascii = "0.1" -atty = "0.2" +is-terminal = "0.4.3" ref-cast = "1.0" atomic = "0.5" parking_lot = "0.12" diff --git a/core/lib/src/log.rs b/core/lib/src/log.rs index f1f213675c..ab1aef3373 100644 --- a/core/lib/src/log.rs +++ b/core/lib/src/log.rs @@ -177,8 +177,9 @@ pub(crate) fn init(config: &crate::Config) { // Set Rocket-logger specific settings only if Rocket's logger is set. if ROCKET_LOGGER_SET.load(Ordering::Acquire) { + use is_terminal::IsTerminal; // Rocket logs to stdout, so disable coloring if it's not a TTY. - if !atty::is(atty::Stream::Stdout) { + if !std::io::stdout().is_terminal() { Paint::disable(); }