diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 8a0849e33b7..900975339fe 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -25,6 +25,7 @@ After processing, the content will be moved to the main changelog and this file ## Fixed - Fix `concurrent map read and map write` runtime fatal in `linuxSystemTray` when the tray menu is updated while the panel reads it. +- Use `log` instead of `fmt` for WebView2 error and stack trace output so messages aren't lost when the app runs without an attached console on Windows. ## Deprecated diff --git a/webview2/pkg/edge/chromium.go b/webview2/pkg/edge/chromium.go index 81387725df8..2d6a9ceb10b 100644 --- a/webview2/pkg/edge/chromium.go +++ b/webview2/pkg/edge/chromium.go @@ -28,13 +28,13 @@ func globalErrorHandler(err error) { return } - fmt.Printf("[WebView2 Error] %v\n", err) + log.Printf("[WebView2 Error] %v\n", err) stackBuf := make([]uintptr, 64) stackSize := runtime.Callers(2, stackBuf) frames := runtime.CallersFrames(stackBuf[:stackSize]) - fmt.Println("\nStack trace:") + log.Printf("\nStack trace:") stackIndex := 1 for { frame, more := frames.Next()