Blitz3D+ Command Reference

DebugLog text$

Parameters

text$ - text to append to the Debug Log

Description

Writes a line of text to the IDE's Debug Log window.

This is the quickest way to trace what your program is doing without touching the display: log variable values, note that a function was reached, record which files loaded. The text appears in the Debug Log pane while the program runs from the IDE in debug mode.

DebugLog only does something when a debugger is attached - in a release build, or with debug mode off, the call is simply ignored. That makes it safe to leave logging lines in shipped code, but also means you will see nothing if you run without debug mode and wonder where your output went.

To build the string, just concatenate: DebugLog "player x="+x+" y="+y.

See also: Stop, RuntimeError, RuntimeStats.

Example

; DebugLog Example
; ----------------

; DebugLog writes a message to the IDE's Debug Log window.
; Run this in debug mode from the IDE to see the messages appear.

Print "Sending three messages to the debug log..."

DebugLog "Player spawned at 10,20"
DebugLog "Enemy count: 5"
DebugLog "Level loaded OK"

Print "Done - open the IDE's Debug Log window to read them."
Print "(DebugLog output goes to the IDE, not to this program window.)"

Print ""
Print "Press any key to close the example"
WaitKey

End

Index