fflush from traceback
Posted: Mon Jan 06, 2014 1:40 am
Debugging Lua errors that occur during loading a module or generating a level can be tricky. The game's standard error dialog is never invoked, and the loading / generating never finishes, so I have to kill the process and check the logfile, which may or may not have gotten the error message flushed to it.
If I understand the code correctly, having main.c's traceback call fflush(stdout); would ensure that Lua errors are always flushed to the log, regardless of what may go wrong at higher-level code or whether or not higher-level code is in a place to check for and display error dialogs.
If I understand the code correctly, having main.c's traceback call fflush(stdout); would ensure that Lua errors are always flushed to the log, regardless of what may go wrong at higher-level code or whether or not higher-level code is in a place to check for and display error dialogs.