From 124e98e94e66d5790d4523adb9cd75f85a4691f4 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Mon, 14 Oct 2019 23:34:54 +0300 Subject: Fix logged config path separators on Windows It was discovered that we were logging path with `\\` instead of `\` as separators on Windows due to use of Debug formatting instead of Display for paths. --- alacritty/src/logging.rs | 6 +++--- alacritty/src/main.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs index d1c95e43..ea44637b 100644 --- a/alacritty/src/logging.rs +++ b/alacritty/src/logging.rs @@ -45,8 +45,8 @@ pub fn initialize( // Use env_logger if RUST_LOG environment variable is defined. Otherwise, // use the alacritty-only logger. - if ::std::env::var("RUST_LOG").is_ok() { - ::env_logger::try_init()?; + if std::env::var("RUST_LOG").is_ok() { + env_logger::try_init()?; Ok(None) } else { let logger = Logger::new(event_proxy); @@ -172,7 +172,7 @@ impl OnDemandLogFile { Ok(file) => { self.file = Some(io::LineWriter::new(file)); self.created.store(true, Ordering::Relaxed); - let _ = writeln!(io::stdout(), "Created log file at {:?}", self.path); + let _ = writeln!(io::stdout(), "Created log file at \"{}\"", self.path.display()); }, Err(e) => { let _ = writeln!(io::stdout(), "Unable to create log file: {}", e); diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index 65e13a62..d3419f78 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -111,7 +111,7 @@ fn main() { // Clean up logfile if let Some(log_file) = log_file { if !persistent_logging && fs::remove_file(&log_file).is_ok() { - let _ = writeln!(io::stdout(), "Deleted log file at {:?}", log_file); + let _ = writeln!(io::stdout(), "Deleted log file at \"{}\"", log_file.display()); } } } @@ -123,7 +123,7 @@ fn main() { fn run(window_event_loop: GlutinEventLoop, config: Config) -> Result<(), Box> { info!("Welcome to Alacritty"); if let Some(config_path) = &config.config_path { - info!("Configuration loaded from {:?}", config_path.display()); + info!("Configuration loaded from \"{}\"", config_path.display()); }; // Set environment variables -- cgit