mirror of https://github.com/rwf2/Rocket.git
Replace 'atty' with 'is-terminal'.
This commit is contained in:
parent
b556ec1bba
commit
2f74380d69
|
@ -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"
|
||||
|
|
|
@ -4,6 +4,7 @@ use std::fmt;
|
|||
use std::str::FromStr;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use is_terminal::IsTerminal;
|
||||
use serde::{de, Serialize, Serializer, Deserialize, Deserializer};
|
||||
use yansi::Paint;
|
||||
|
||||
|
@ -178,7 +179,7 @@ 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) {
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue