diff options
author | Kirill Chibisov <wchibisovkirill@gmail.com> | 2019-10-14 23:34:54 +0300 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-10-14 22:34:54 +0200 |
commit | 124e98e94e66d5790d4523adb9cd75f85a4691f4 (patch) | |
tree | a88e8ae7dcc035fee159dc142a35eb484dbd4fe8 | |
parent | 401c2aab964b60e8c3b072e5098ba8e366d04944 (diff) | |
download | alacritty-124e98e94e66d5790d4523adb9cd75f85a4691f4.tar.gz alacritty-124e98e94e66d5790d4523adb9cd75f85a4691f4.zip |
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.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty/src/logging.rs | 6 | ||||
-rw-r--r-- | alacritty/src/main.rs | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ce817613..44d36a41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Crash when trying to start on X11 with a Wayland compositor running - Crash with a virtual display connected on X11 - GPU memory usage has been decreased by disabling allocation of depth and stencil buffers +- Use `\` instead of `\\` as path separators on Windows for logging config file location ### Removed 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<Event>, config: Config) -> Result<(), Box<dyn Error>> { 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 |