Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Add catch_error_add_debug_message for error log?

A topic by The any Key created Dec 31, 2019 Views: 361 Replies: 5
Viewing posts 1 to 4

The error message is gold to get when it comes to debugging. But it would be even better to get the console output (all that is from show_debug_message). So would it be possible in a future version, add something like catch_error_add_debug_message(message). That is saved along with the error message if the game crash. These logs would provide some additional data that lead up to the crash.

Developer

Wouldn't this achieve the same effect as writing the message into a text file and then checking for that if the error-dump file exists?

(2 edits)

Tested that some time ago and the game becomes very slow and get lag spikes, because of all the open and close file operations. But I can test it again and see it it was just a glitch or something. It can be done with a timer that only save it every few seconds, but then you lose the last second of log data if it crash.

Did some tests and writing to file is too performance expensive. I profiled a quite long process and it logged 100-200 debug messages. And it took 15 seconds when I logged to a file. When disabled, it took 7 seconds to run the process. So the write to file cost me 8 seconds.

Developer

See if using this extension and rewinding-writing-flushing (flush may not be needed) the file works better?

Many thanks, will do some tests and report back.