Lua Class - debug

debug is a class in the Teverse Lua API that contains 0 properties, 4 methods and 4 events.

This class cannot be constructed, it is managed by Teverse.

This singleton provides a safe wrapper for accessing some essential Lua debugging functions. It is accessed through teverse.debug and requires the permission to be defined in your tevapp manifest file.

This singleton can be used to create an interface for viewing an app's output.

Properties
Methods
clearOutputHistory( )

Clears the output history

CODE SAMPLE
debug:clearOutputHistory() --> 
table getOutputHistory( )

Returns a table of dictionaries: {time, message, messageType}

CODE SAMPLE
debug:getOutputHistory() --> {}
schedulerUi( )

Undocumented

CODE SAMPLE
debug:schedulerUi() --> 
string traceback( )

Returns a string with a traceback of the stack call.

CODE SAMPLE
debug:traceback() --> ""
Events
:on("changed", function( string property, variant oldValue, variant newValue ) end)

Fired when a property is changed.

CODE SAMPLE
debug:on("changed", function(property, oldValue, newValue)
  print(property) --> ""  print(oldValue) --> variant  print(newValue) --> variant
end)
:on("error", function( string message ) end)

Fired when a error occurs

CODE SAMPLE
debug:on("error", function(message)
  print(message) --> ""
end)
:on("print", function( string message ) end)

Fired when a print occurs

CODE SAMPLE
debug:on("print", function(message)
  print(message) --> ""
end)
:on("warn", function( string message ) end)

Fired when a warn occurs

CODE SAMPLE
debug:on("warn", function(message)
  print(message) --> ""
end)

Some sections of our docs are maintained on github.