Skip to content
TimotheeGreg edited this page Aug 25, 2023 · 20 revisions

trace(message, [color=15])

Parameters

  • message : the string to print.
  • color : a color index (0..15)

Description

This is a service function, useful for debugging. It prints the supplied string or variable to the console in the (optional) color specified.

Tips:

  1. The Lua concatenation operator is .. (two periods)
  2. Use the console cls command to clear the output from trace
  3. Simple variables are automatically converted to strings

Example

Example

-- trace demo
cls()
function TIC()
	trace('Hello console:'..time())
	trace('This text is blue',8)
end

GIF example:

trace_debugging_example

Clone this wiki locally