Stdout and stderr to file

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aaron C Robinson

I would like to take stdout and stderr and redirect them to a file/log and I am not currently seeing how to easily achieve this in the project settings or at a coding level. I would hope this could be achieved with GDScript but if we had to utilize C#, I am open and comfortable with that.

I am trying grow as a game developer more and exploring Godot for a little prototype. One of the major challenges generally with getting all your processes down is making sure the build is good. I have had a few issues getting projects to export and after getting them to export they do not run on the other machines. I am a windows user and my partner is a windows user. No matter how I seem to execute Godot on another non-dev computer, I cannot get the output of a clear error message the engine is flagging. This is the ultimately issue I will want to address but to get there, I need to actually see what the computer is telling me (which right now I cannot).

I have looked around at logging solutions and what I have found is just extra logging sugar but what I want is to actually get raw stderr/stdout from my users machines and have that flle for review. Can anyone give advice on solving this issue of logging stderr? Otherwise, I am guessing I will be forced to use C# which may be the only path to solution that exists? That confuses me a bit because this seems like this would be a common request, so maybe the issue is Windows specific?

As a small update, I was able to get the game to build by changing my Godot to the standard version from the Mono version. The issue seems to be related in getting mono compiled correctly in the executable but as I am not currently using C#, it was fine to use the standard version.

I am still interested in any solutions to this question, as I could see this information being helpful with future issues.

Aaron C Robinson | 2019-01-09 02:32

:bust_in_silhouette: Reply From: Charlie

I ran into this question while looking for an answer myself.

After a bit of digging, I found answer in Project Settings > Logging > File Logging > Enable File Logging. Check the box and you’re set! (Well, this is stdout anyway. Maybe also stderr but I’m not sure about that.)