Documentation in progress: please use the 3.4 Reference Manual.

Name

Debug — The Laszlo debugger

Synopsis

JavaScript: Debug
Type: Object
Access: public
Build Flags: debug
Topic: LZX.Debugging

Description

Automatically created when an application is compiled in debug mode (requested by either using the canvas (LzCanvas)debug='true' attribute or by loading the application using the ?debug=true option).

Details

Static Properties (9)

atFreshLine
static public var atFreshLine = true;
Generic low-level output
atPrompt
static public var atPrompt = false;
formatToString
static public var formatToString;
messageLevel
static public var messageLevel = ALL;
Debug messages are enabled/disabled by the setting of Debug.messageLevel. The valid levels are one of the keys of Debug.messageLevels. All messages of a lower level than the current setting will be suppressed
messageLevels
static public var messageLevels = { ... };
Possible values of Debug.messageLevel (q.v.)
pad
static public var pad;
printLength
static public var printLength = 1024;
Debug.write will truncate the printed representation of any object whose length is greater than Debug.printLength (default value 1024). See also: Debug.inspect.printLength
printPretty
static public var printPretty = true;
Debug.write will print 'pretty' versions of objects if this is true (default is true).
showInternalProperties
static public var showInternalProperties = false;
Debug.inspect will show internal properties if this is true (default is false).

Static Methods (16)

backtrace()
static public function backtrace(skip);
Snapshot the current call stack into a LzBacktrace object which can be printed or inspected Only available if lfc is compiled with --option debugBacktrace=true
debug()
static public function debug(control, args);
Display an debug on the console Takes a format control and any number of arguments. Cf., Debug.format
deprecated()
static public function deprecated(obj : lznode, method : Function, replacement);
Deprecation message
error()
static public function error(control, args);
Display an error on the console Takes a format control and any number of arguments. Cf., Debug.format
format()
static public function format(control : string, args);
Formatted output. Formats its arguments using ???.
freshLine()
static public function freshLine();
Puts the typeout on a fresh line
freshPrompt()
static public function freshPrompt();
Emit a prompt if not at one
info()
static public function info(control, args);
Display an info on the console Takes a format control and any number of arguments. Cf., Debug.format
inspect()
static public function inspect(obj : Object, reserved : Null);
Display the properties of an object on the debug console. Debug.inspect displays each of the properties of its argument object using Debug.write. Properties that have complex values (or long representations that are abbreviated) are displayed as links. Clicking on the link will invoke Debug.inspect on that object.
monitor()
static public function monitor();
trace()
static public function trace(who : Object, what : String);
Trace a method of an object. Will trace the named method of the object and print a message to the Debug console each time it is called or returned from. When called, the message will give a timestamp, the name of the function and the arguments it was called with. When returned from, the message will give the name of the function and the value it returned (if any). If backtraces are enabled, inspecting the message will reveal the call chain that caused the modification.
unmonitor()
static public function unmonitor();
untrace()
static public function untrace(who : Object, what : String);
Stop tracing a method of an object.
versionInfo()
static public function versionInfo();
Display version info
warn()
static public function warn(control, args);
Display a warning on the console Takes a format control and any number of arguments. Cf., Debug.format
write()
static public function write();
Display one or more objects on the debug console. Note: Debug.format() allows more control over displaying multiple objects. Use it instead of Debug.write. Debug.write displays objects on the debug console in an informative format. Simple objects are represented as themselves. Printed Complex objects are represented by their type and a concise description. Long representations (and long Strings) are abbreviated if they are longer than Debug.printLength. Complex objects and abbreviated objects presented as links. Clicking on the link will invoke Debug.inspect() on the object, giving more detail.

JavaScript Synopsis

public var Debug = { ... };