fflush from traceback

Moderator: Moderator

Post Reply
Message
Author
Castler
Thalore
Posts: 153
Joined: Mon Mar 25, 2013 10:09 pm

fflush from traceback

#1 Post by Castler »

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.
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: fflush from traceback

#2 Post by jenx »

Castler wrote: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.
you can force constant flushing by running as te4.exe --flush-stdout in window. juse baretail.exe or similar to follow it.

it will slow the game only slightly.
MADNESS rocks

darkgod
Master of Eyal
Posts: 10747
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: fflush from traceback

#3 Post by darkgod »

yup good idea
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply