-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print() to log text, does not appear from exported app, until after it is closed. #33253
Comments
Flushing causes overhead, so it makes sense that it happens only once if you disable debug, no? |
No it does not make sense. If you are printing to logs then it should show up in the logs. The programmer decides if he wants it or not. |
I wonder if this is related to #33255 somehow. See also #2233 (comment). While those issues are about |
printerr() works fine but also flushes out print() output if it comes after. So in some respects it can be a workaround for flush. |
I deployed a server using Godot, which crashes due to an unknown event. Because there is nothing written to the log files, there is no chance to fix anything. I'm not sure if this is the same issue as discussed here. I tick "Enable File Logging" just as explained in the original post. The logs/log.txt file stays empty (0 Byte). I tried:
The log files stay empty. I have no idea how to fix that. |
^ |
See if this article adds anything to help https://medium.com/@silocoder/using-log-files-to-debug-godot-game-engine-apps-14c191df6580 Also I am wondering if reading a log file will force it to be flushed. |
Probably not; Godot handles when it should flush the standard output/error stream. |
@wyattbiker I read this before, no luck. I ended up using a pipe to write the printed output to a file... |
This was implemented by #44393, closing. |
Godot version:
Any
OS/device including version:
Any
Issue description:
print() to log file will not show the output until after the app is closed. This only happens when the executable is exported with
Export With Debug
flag unchecked.Steps to reproduce:
Put this code in _ready() of a node script.
Make sure you have enabled logging in Project Settings.
Export With Debug
flag before Save To File dialog.Somehow it is not flushing output while app is running. This is not good if you are monitoring log output of an app.
The text was updated successfully, but these errors were encountered: