+1 vote

So for quite a few occasions I was unable to grab the output since the print happened before the program ends, since I guess the output buffer was not flushed when exiting.

in Engine by (111 points)

The print output does not appear in the output tab in the editor?

Normally it does, but a few print()s right before quitting the program does not.

So weird... can i see the code?

This could demonstrate:

extends Control

func _ready():
    print("Can you see me?")
    get_tree().quit()

ok, i can confirme same behavior here, a workaround is:

func _ready():
    print("Can you see me?")
    get_node("Timer").start()

func _on_Timer_timeout():
    get_tree().quit()

the time delay is 0.1, is this a viable option for you?

Thanks for the tip. That feels like the print function is called in the future event loop, which may have been terminated by get_tree().quit() before running. I'll file a bug to discuss this with the team.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.