-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
[Core] Add Engine.print_to_stdout
setting to control printing
#90955
Conversation
doc/classes/Engine.xml
Outdated
@@ -337,6 +337,10 @@ | |||
[b]Note:[/b] This property does not impact the editor's Errors tab when running a project from the editor. | |||
[b]Warning:[/b] If set to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a [code]@tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default). | |||
</member> | |||
<member name="print_to_stdout" type="bool" setter="set_print_to_stdout" getter="is_printing_to_stdout" default="true"> | |||
If [code]false[/code], stops printing messages to the console and editor Output log. This property is equivalent to the [member ProjectSettings.application/run/disable_stdout] project setting. | |||
[b]Note:[/b] This stops printing any errors or warnings produced by scripts to the Output log, but not to the console, for more details see [member print_error_messages]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions for more details and wording here is welcome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note seems to directly contradict the line just above it:
stops printing messages to the console and editor Output log.
This stops printing any errors or warnings produced by scripts to the Output log, but not to the console,
From my testing, stdout is disabled in all these 3 areas when this property is set to false
:
- Console
- Editor output panel
- File logging (as it's a byproduct of console output)
I would also mention file logging in this description since it's not currently mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a look, I think the meaning here is that messages, with print
are blocked, but errors are still printed to the console, will confirm
The behavior is already that errors and warnings aren't printed in the editor log, but are printed to the error output, will improve wording
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be clearer now, also added a cross-ref to print
c376f59
to
8e1e9c8
Compare
8e1e9c8
to
eaabb11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected (even if Disable Stdout is initially enabled in the project settings).
However, if you start the engine with the --quiet
command line argument, the project can make itself "unquiet" at runtime. This is not necessarily a dealbreaker (use godot &> /dev/null
or godot > NUL
if you want a strict quiet mode), but it's worth documenting.
Testing project: test_pr_90955.zip
eaabb11
to
713f290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good to me.
Engine.print_to_stout
setting to control printingEngine.print_to_stdout
setting to control printing
713f290
to
16e7f4b
Compare
16e7f4b
to
9ba4100
Compare
Also added notes to the related project settings pointing to the `Engine` properties.
9ba4100
to
d49ec39
Compare
Thanks! |
Thank you! |
Also added notes to the related project settings pointing to the
Engine
properties.This essentially grants runtime control over the
CoreGlobals.print_line_enabled
flag, matching theapplication/run/disable_stdout
project setting, and matching the existingprint_error_messages
.Unsure about the exact naming for this, the global flag is called
print_line_enabled
but I don't think that's as clear, named it based on the project setting instead, but open to suggestions for different namingThe one possible concern I see (though already shared with
disable_stdout
) is that this would not be connected with the editor, an alternative name would beprint_output