Module debug

Additions to the debug module

Functions

debug () debug.say is also available as the global function debug
say (n, ...) Print a debugging message
trace (event) Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set.

Tables

_DEBUG To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.


Functions

debug ()
debug.say is also available as the global function debug

See also:

say (n, ...)
Print a debugging message

Parameters

  • n: debugging level, defaults to 1
  • ...: objects to print (as for print)
trace (event)
Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution.

Parameters

  • event: event causing the call

Tables

_DEBUG
To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.

Fields

  • level: debugging level
  • call: do call trace debugging
  • std: do standard library debugging (run examples & test code)

Valid XHTML 1.0!