1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

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.
This commit is contained in:
Kirill Chibisov 2019-10-14 23:34:54 +03:00 committed by Christian Duerr
parent 401c2aab96
commit 124e98e94e
3 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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);

View file

@ -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