Skip to content

Logging and errors

Use GD.print to send messages to both the terminal and Godot's Output panel. Kotlin and Scala's println and Java's System.out.println write to standard output only.

1
GD.print("Player is ready")
1
GD.print("Player is ready");
1
GD.print("Player is ready")

Use GD.pushError and GD.pushWarning to report a diagnostic to Godot's debugger:

1
2
GD.pushError("Player spawn point is missing")
GD.pushWarning("Using the default player name")
1
2
GD.pushError("Player spawn point is missing");
GD.pushWarning("Using the default player name");
1
2
GD.pushError("Player spawn point is missing")
GD.pushWarning("Using the default player name")

Exceptions do not stop the game

An exception escaping a JVM callback is logged with its stack trace. The Godot-side call returns a default value and the game keeps running. Statements after the throw in that callback do not run.