Enable ASCII escape sequences in Windows consoles.

This commit is contained in:
Sergio Benitez 2017-07-26 22:41:01 -04:00
parent 3abc813605
commit b276e1d51f
2 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,7 @@ categories = ["web-programming::http-server"]
tls = ["rustls", "hyper-sync-rustls"]
[dependencies]
yansi = { version = "0.3", features = ["nightly"] }
yansi = { version = "0.3.1", features = ["nightly"] }
log = "0.3"
url = "1"
toml = "0.4.2"

View File

@ -143,6 +143,8 @@ impl Log for RocketLogger {
pub fn try_init(level: LoggingLevel, verbose: bool) {
if !::isatty::stdout_isatty() {
Paint::disable();
} else if cfg!(windows) {
Paint::enable_windows_ascii();
}
let result = log::set_logger(|max_log_level| {