mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 19:02:07 +00:00
Merge pull request #2235 from zed-industries/no-panic-uploads-in-debug
Don't upload panic files when running in a PTY
This commit is contained in:
commit
01bbf20962
1 changed files with 8 additions and 7 deletions
|
@ -120,7 +120,9 @@ fn main() {
|
|||
));
|
||||
|
||||
watch_settings_file(default_settings, settings_file_content, themes.clone(), cx);
|
||||
upload_previous_panics(http.clone(), cx);
|
||||
if !stdout_is_a_pty() {
|
||||
upload_previous_panics(http.clone(), cx);
|
||||
}
|
||||
|
||||
let client = client::Client::new(http.clone(), cx);
|
||||
let mut languages = LanguageRegistry::new(login_shell_env_loaded);
|
||||
|
@ -331,6 +333,11 @@ fn init_panic_hook(app_version: String) {
|
|||
),
|
||||
};
|
||||
|
||||
if is_pty {
|
||||
eprintln!("{}", message);
|
||||
return;
|
||||
}
|
||||
|
||||
let timestamp = chrono::Utc::now().format("%Y_%m_%d %H_%M_%S").to_string();
|
||||
let panic_file_path =
|
||||
paths::LOGS_DIR.join(format!("zed-{}-{}.panic", app_version, timestamp));
|
||||
|
@ -343,12 +350,6 @@ fn init_panic_hook(app_version: String) {
|
|||
write!(&mut panic_file, "{}", message).log_err();
|
||||
panic_file.flush().log_err();
|
||||
}
|
||||
|
||||
if is_pty {
|
||||
eprintln!("{}", message);
|
||||
} else {
|
||||
log::error!(target: "panic", "{}", message);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue