mirror of
https://github.com/alacritty/alacritty.git
synced 2025-07-31 22:03:40 -04: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:
parent
401c2aab96
commit
124e98e94e
3 changed files with 6 additions and 5 deletions
|
@ -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 when trying to start on X11 with a Wayland compositor running
|
||||||
- Crash with a virtual display connected on X11
|
- Crash with a virtual display connected on X11
|
||||||
- GPU memory usage has been decreased by disabling allocation of depth and stencil buffers
|
- 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
|
### Removed
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ pub fn initialize(
|
||||||
|
|
||||||
// Use env_logger if RUST_LOG environment variable is defined. Otherwise,
|
// Use env_logger if RUST_LOG environment variable is defined. Otherwise,
|
||||||
// use the alacritty-only logger.
|
// use the alacritty-only logger.
|
||||||
if ::std::env::var("RUST_LOG").is_ok() {
|
if std::env::var("RUST_LOG").is_ok() {
|
||||||
::env_logger::try_init()?;
|
env_logger::try_init()?;
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
let logger = Logger::new(event_proxy);
|
let logger = Logger::new(event_proxy);
|
||||||
|
@ -172,7 +172,7 @@ impl OnDemandLogFile {
|
||||||
Ok(file) => {
|
Ok(file) => {
|
||||||
self.file = Some(io::LineWriter::new(file));
|
self.file = Some(io::LineWriter::new(file));
|
||||||
self.created.store(true, Ordering::Relaxed);
|
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) => {
|
Err(e) => {
|
||||||
let _ = writeln!(io::stdout(), "Unable to create log file: {}", e);
|
let _ = writeln!(io::stdout(), "Unable to create log file: {}", e);
|
||||||
|
|
|
@ -111,7 +111,7 @@ fn main() {
|
||||||
// Clean up logfile
|
// Clean up logfile
|
||||||
if let Some(log_file) = log_file {
|
if let Some(log_file) = log_file {
|
||||||
if !persistent_logging && fs::remove_file(&log_file).is_ok() {
|
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>> {
|
fn run(window_event_loop: GlutinEventLoop<Event>, config: Config) -> Result<(), Box<dyn Error>> {
|
||||||
info!("Welcome to Alacritty");
|
info!("Welcome to Alacritty");
|
||||||
if let Some(config_path) = &config.config_path {
|
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
|
// Set environment variables
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue