+2 votes

Do you guys have better way to print log In Godot IDE?

in Engine by (14 points)

Well the only thing that would come to my mind, is to use printerr.
Otherwise I would suggest the debug tool, for debugging.
Or even write your logs in a file.

1 Answer

+1 vote

It's been two years since this was asked, but to anyone who stumbles on this question:

You can print colored text using ANSI escape characters. However you need to literally print the escape character because printing "/e" will not work. You can copy and paste the character and store it on a string.

If you are using Windows you will also need to change a system register to allow Godot to use the console ANSI interpreter:
HKEY_CURRENT_USER > Console > VirtualTerminalLevel to 0x1.

I made a plugin to help with that:
https://godotengine.org/asset-library/asset/772

by (29 points)

Thanks a lot for this! will make something very naughty with it ;)
I wonder, how did you figure out what the escape character was? in the code it shows as a square, and looking it up on google gives 0 results. Godot editor don't show it at all.
I made a GIF to ANSI terminal viewer in PHP once and it was easier than this
I'm on Linux btw not Windows

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.