mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
Always log panics (#2896)
I just panicked and wanted to see the cause, but forgot that panic files get deleted when Zed uploads them. Release Notes: - Panics are now written to `~/Library/Logs/Zed/Zed.log`
This commit is contained in:
commit
b2d735e573
1 changed files with 5 additions and 5 deletions
|
@ -491,11 +491,11 @@ fn init_panic_hook(app: &App, installation_id: Option<String>, session_id: Strin
|
|||
session_id: session_id.clone(),
|
||||
};
|
||||
|
||||
if is_pty {
|
||||
if let Some(panic_data_json) = serde_json::to_string_pretty(&panic_data).log_err() {
|
||||
eprintln!("{}", panic_data_json);
|
||||
}
|
||||
} else {
|
||||
if let Some(panic_data_json) = serde_json::to_string_pretty(&panic_data).log_err() {
|
||||
log::error!("{}", panic_data_json);
|
||||
}
|
||||
|
||||
if !is_pty {
|
||||
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 panic_file_path = paths::LOGS_DIR.join(format!("zed-{}.panic", timestamp));
|
||||
|
|
Loading…
Reference in a new issue