Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The Debug class pertaining to the Sys namespace can be used for providing tracing and debugging functionality in your applications. The Debug class contains a list of methods that can be used to define breakpoints in your scripts and handle trace output. Table 19.1 lists the members of this class.
| Member | Purpose |
|---|---|
| Sys.Debug.trace(message) | Displays the message as text in the debugger console or to the TraceConsole text area. |
| Sys.Debug.clearTrace() | Used to clear all trace information from the TraceConsole text area. |
| Sys.Debug.fail(message) | Breaks the debugger and displays a message in the TraceConsole text area. |
| Sys.Debug.assert(condition, message, displayCaller) | Checks whether the condition specified is false; if so, it displays a message and prompts the user to break into the debugger. |
| Sys.Debug.traceDump(object, name) | Dumps an object to the debugger console or to the TraceConsole text area. |