Skip to content
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

debug_print option for printing stuff to the debugger window? #6253

Closed
Sslaxx opened this issue Aug 23, 2016 · 5 comments
Closed

debug_print option for printing stuff to the debugger window? #6253

Sslaxx opened this issue Aug 23, 2016 · 5 comments

Comments

@Sslaxx
Copy link

Sslaxx commented Aug 23, 2016

Operating system or device - Godot version:
OS is N/A, Godot version? 2.0 and up I guess.

Issue description (what happened, and what was expected):
Inspired by https://twitter.com/ProbDenis/status/741981375604137984 - when running a game in debug mode (be it in the editor or using a debug-enabled export option), it'd be nice to have a print_debug command (or similar), so that certain types of messages don't get printed in a release game (if run from terminal or whatnot).

Functionally it should be identical to print as-is, other than it not printing to stdout but stderr.

@vnen
Copy link
Member

vnen commented Aug 23, 2016

Right now you can use if OS.is_debug_build(): print("text").

@Sslaxx
Copy link
Author

Sslaxx commented Aug 23, 2016

Hadn't been aware of the existence of OS.is_debug_build, nice to know something like that exists. But yes, a debug_print would be a little less work there all the same.

@Gastronok
Copy link
Contributor

If you're looking to print to stderr, you can also use printerr().

@bojidar-bg
Copy link
Contributor

@Gastronok The problem with printerr is that it won't show up in the editor at all, which decreases its utility a lot.

@Calinou
Copy link
Member

Calinou commented Apr 11, 2018

Since it is possible to easily implement this feature by adding a very short function to a singleton, I'm closing this. (It is also more flexible this way.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants