From f83b1ba2a7cecd50a696dbd7a3e18201f18a6bb1 Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Tue, 25 Nov 2025 08:56:29 +0800 Subject: [PATCH] chore: write panic message to stdout in panic hook (#989) This commit updates the panic hook implementation to log the panic message to stdout as well, which would make debugging easier. It is hightly possible that a panic may get ignored by us when we run Coco app in the dev mode (since the hook only writes msg to the panic log file). --- docs/content.en/docs/release-notes/_index.md | 2 ++ src-tauri/src/main.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index 8004d297..dfc2a2bb 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -20,6 +20,8 @@ Information about release notes of Coco App is provided here. ### ✈️ Improvements +- chore: write panic message to stdout in panic hook #989 + ## 0.9.0 (2025-11-19) ### ❌ Breaking changes diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a71cd84c..acd8bcb9 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -69,6 +69,9 @@ fn setup_panic_hook() { eprintln!("Panic hook error: Failed to open panic log file: {}", e); } } + + // Write to stdout, with a new-line char since stdout is line-buffered. + println!("{}\n", panic_log); })); }