mirror of
https://github.com/wez/wezterm.git
synced 2024-11-22 13:16:39 +03:00
parent
49296500da
commit
764cc8bb3d
@ -260,13 +260,18 @@ fn prune_old_logs() {
|
||||
}
|
||||
|
||||
fn setup_pretty() -> (LevelFilter, Logger) {
|
||||
prune_old_logs();
|
||||
|
||||
let base_name = std::env::current_exe()
|
||||
.ok()
|
||||
.and_then(|p| p.file_name().map(|s| s.to_string_lossy().to_string()))
|
||||
.unwrap_or_else(|| "wezterm".to_string());
|
||||
|
||||
if base_name.contains("gui") {
|
||||
// Only tidy up logs when the gui process is starting.
|
||||
// rationale: `wezterm cli` commands should have as low startup
|
||||
// overhead as possible
|
||||
prune_old_logs();
|
||||
}
|
||||
|
||||
let log_file_name = config::RUNTIME_DIR.join(format!("{}-log-{}.txt", base_name, unsafe {
|
||||
libc::getpid()
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user