Messages show up in the console under the editor. Errors thrown by your code show up there too.
# log
Prints a message.
AssemblyScript C# Python
console . log ( message: string ) : void
console . log ( "x = " + x. toString ( ) ) Console. Log ( string message)
Console. Log ( $"x = { x : F1} " ) ; print ( * values)
print ( f"x = { x: .1f } " )
# warn
Prints a warning.
AssemblyScript C# Python
console . warn ( message: string ) : void Console. Warn ( string message)
Python has no separate warning level. Use print(), or print to sys.stderr to show the message as an error.
# error
Prints an error.
AssemblyScript C# Python
console . error ( message: string ) : void Console. Error ( string message) import sys
print ( "Something went wrong" , file = sys. stderr)
# Debugging tips
Don't log every frame unless you need to. At 60 FPS the console fills fast. Log in events, or every N frames.
Draw debug info on the canvas instead. text() Canvas.Text() text() with screen.fps() Screen.FPS fps() , positions or state is often clearer than the console.
AssemblyScript C# Python
fill ( 255 , 255 , 255 )
font ( "monospace" , 12 )
text ( "FPS " + Math. round ( screen. fps ( ) ) . toString ( ) , 8 , 8 )
text ( "x " + x. toString ( ) , 8 , 24 ) Canvas. Fill ( 255 , 255 , 255 ) ;
Canvas. Font ( "monospace" , 12 ) ;
Canvas. Text ( $"FPS { Screen. FPS : F0} " , 8 , 8 ) ;
Canvas. Text ( $"x { x : F1} " , 8 , 24 ) ; fill( 255 , 255 , 255 )
font( "monospace" , 12 )
text( f"FPS { fps( ) : .0f } " , 8 , 8 )
text( f"x { x: .1f } " , 8 , 24 )