From b276e1d51fca2b794c62ce605f7f62bb079ef9ed Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Wed, 26 Jul 2017 22:41:01 -0400 Subject: [PATCH] Enable ASCII escape sequences in Windows consoles. --- lib/Cargo.toml | 2 +- lib/src/logger.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 5ce4c8fb..cb857fe1 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -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" diff --git a/lib/src/logger.rs b/lib/src/logger.rs index 5e61bc39..6c9b61ad 100644 --- a/lib/src/logger.rs +++ b/lib/src/logger.rs @@ -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| {