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.
Debug log when launched in debug-mode
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: Debug log when launched in debug-mode
+1. Also the ability to log the console to disk so we can debug issues that cause Factorio to crash
Re: Debug log when launched in debug-mode
print() prints to stdout, which can be piped to any file?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Debug log when launched in debug-mode
and where is stdout displayed on Windows when you launch Factorio from the gui? Or from cmd, or powershell? I've yet to find it in any of those cases, let alone be able to redirect it lol. hoho said here (though I'm not sure what OS hoho is on...)ssilk wrote:print() prints to stdout, which can be piped to any file?
edit: +1 btwhoho wrote:It also failied when I ran it from bash and even DebugView didn't show anything.
And, if possible, it'd be nice if --debug would not stop after the first loading error but continue trying to load everything (obviously some would be redundant, but theoretically a help when updating mods), of course it'd still close afterwards if any errors were encountered but...maybe too much work lol
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: Debug log when launched in debug-mode
So it logs to the console under Linux and OSX? As FreeER mentioned it does not work under windows.ssilk wrote:print() prints to stdout, which can be piped to any file?