Debug log when launched in debug-mode
Posted: Wed Jul 02, 2014 9:12 am
Yesterday when I tried making my first mod I had a few issues with code in data.lua. As that gets loaded during startup there is currently no way to get any meaningful information out of it and debugging problems is complicated to say the least.
What about allowing modders to use a special debug-logging method that would put text to stdout/err but only if the game is launched with e.g --debug flag? Without the flag the logging-call wouldn't do anything so it shouldn't make the game much slower for normal gameplay so that devs don't even have to comment the calls out for their releases.
I know there is the game.makefile that could be used for logging but that can't be used during startup as game object doesn't exist. In-game it's also possible to write stuff to screen but when one needs to log a lot of information for whatever reason that isn't really a viable option either.
What about allowing modders to use a special debug-logging method that would put text to stdout/err but only if the game is launched with e.g --debug flag? Without the flag the logging-call wouldn't do anything so it shouldn't make the game much slower for normal gameplay so that devs don't even have to comment the calls out for their releases.
I know there is the game.makefile that could be used for logging but that can't be used during startup as game object doesn't exist. In-game it's also possible to write stuff to screen but when one needs to log a lot of information for whatever reason that isn't really a viable option either.