Always log panics

This commit is contained in:
Nathan Sobo 2023-08-25 21:42:18 -06:00
parent 8ddee0e58d
commit 7cd416c63e

View file

@ -495,11 +495,11 @@ fn init_panic_hook(app: &App, installation_id: Option<String>) {
installation_id: installation_id.clone(), installation_id: installation_id.clone(),
}; };
if is_pty { if let Some(panic_data_json) = serde_json::to_string_pretty(&panic_data).log_err() {
if let Some(panic_data_json) = serde_json::to_string_pretty(&panic_data).log_err() { log::error!("{}", panic_data_json);
eprintln!("{}", panic_data_json); }
}
} else { if !is_pty {
if let Some(panic_data_json) = serde_json::to_string(&panic_data).log_err() { if let Some(panic_data_json) = serde_json::to_string(&panic_data).log_err() {
let timestamp = chrono::Utc::now().format("%Y_%m_%d %H_%M_%S").to_string(); 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", timestamp)); let panic_file_path = paths::LOGS_DIR.join(format!("zed-{}.panic", timestamp));