godot icon indicating copy to clipboard operation
godot copied to clipboard

Show a GUI alert when crashing on desktop platforms

Open Calinou opened this issue 3 years ago • 18 comments

This makes it possible to know that Godot has crashed without looking at the console (which may not be visible to the user).

  • Change the window title while dumping the backtrace, as this can take a while to finish.
  • If file logging is enabled, print path to log file to standard error and the GUI alert.
  • Clicking OK will open the log file in the default program associated with .log files. Notepad has native associations for .log on Windows, so this will work on Windows too (once this PR is ported to Windows).

  • This closes https://github.com/godotengine/godot-proposals/issues/7917.

Preview

Linux

https://user-images.githubusercontent.com/180032/173110079-8756207b-cb3d-4b31-af61-6ccf0d690129.mp4

Windows

image

macOS

Screenshot_20240206_195358 Screenshot_20240206_195417

TODO

  • [ ] Consider adding a headless handler for OS::alert(), so we don't have to hack around it here. Make this handler print the string with some special formatting around it, but without the blocking behavior (as this behavior is undesired in headless mode).
  • [x] Port changes to Windows. Everything seems to work there 🙂
  • [x] Port changes to macOS. This is now functional thanks to @bruvzg, but https://github.com/godotengine/godot/pull/87842 needs to be merged if we want it to work with OS.crash() (the method used for testing this crash handler).
  • [ ] Redo for 3.x once everything is OK.

Production edit: closes godotengine/godot-roadmap#5

Calinou avatar Jun 10 '22 16:06 Calinou