-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add INFO_PRINT()
and push_info()
for important but "expected" messages
#1378
Comments
Yeah, see example use case where existing warning messages could be converted to informational messages as seen in godotengine/godot#39396. Having ability to control the severity/verbosity of those type of messages would also be nice to have. The existence of dedicated informational prints may also remove the need for using |
Holy crap, i didnt know push_error and push_warn existed! |
I created a quick version of this in a singleton because I wanted to be able to disable all of the printed 'notes' and warnings with just a boolean toggle when I was done testing something and wanted to see my other print statements without the console being so cluttered. Would be nice to have a toggle in the Here's what I did:
|
@Error7Studios This pull request will address the need for filtering: godotengine/godot#41321 |
I started working on this, but I can't get it to display in the editor Output log when |
See also #919.
Describe the project you are working on:
The Godot editor 🙂
Describe the problem or limitation you are having in your project:
We currently have
ERR_PRINT()
andWARN_PRINT()
macros to print error and warning messages respectively. (These are available aspush_error()
andpush_warning()
in GDScript.)However, we don't have an equivalent for informational prints that are not errors or warnings. We can use
print()
, but this is typically used for debugging instead.Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Add an
info
logging category for messages that are more important than others, but aren't considered errors or warnings.This will also be helpful once we implement filtering messages by category in the editor's Output panel.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Add a
INFO_PRINT()
macro in C++ and expose apush_info()
global scope method in GDScript (and by extension, C#).Unlike the warning and error print handlers, the info print handler should not print a stack trace to the terminal since the user doesn't need to know the message's origin. The message should also not appear in the editor's Errors panel.
In the terminal, we can use the
\e[1m
(bold) ANSI escape code for coloring the message. This makes it easier to dinstinguish from standardprint()
s.If this enhancement will not be used often, can it be worked around with a few lines of script?:
It can be implemented by a script, but it's not ideal as we'd prefer to have a standard way of reporting informational messages.
Is there a reason why this should be core and not an add-on in the asset library?:
See above.
The text was updated successfully, but these errors were encountered: