mirror of https://github.com/rwf2/Rocket.git
Don't color logs on Windows if enabling ASCII escapes fails.
This commit is contained in:
parent
bd6cdecf00
commit
7b4b0646c5
|
@ -135,10 +135,8 @@ impl log::Log for RocketLogger {
|
|||
}
|
||||
|
||||
pub(crate) fn try_init(level: LoggingLevel, verbose: bool) {
|
||||
if !::isatty::stdout_isatty() {
|
||||
if !::isatty::stdout_isatty() || (cfg!(windows) && !Paint::enable_windows_ascii()) {
|
||||
Paint::disable();
|
||||
} else if cfg!(windows) {
|
||||
Paint::enable_windows_ascii();
|
||||
}
|
||||
|
||||
push_max_level(level);
|
||||
|
@ -146,6 +144,8 @@ pub(crate) fn try_init(level: LoggingLevel, verbose: bool) {
|
|||
if verbose {
|
||||
eprintln!("Logger failed to initialize: {}", e);
|
||||
}
|
||||
|
||||
pop_max_level();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue