Client Class wwDebug

This class provides minimal debug trace functionality that allows capturing debug messages and storing them to a string. The messages are captured in a buffer that can be retrieved with toString().

You can call debug.setOutput() to route all output to a specific HTML control in real time. If you have trace enabled it will write the output from write and writeLn to the specified control.

A default instance called _debug gets instantiated into the page so it can be used at any time where the script library is loaded.

// *** All debug output now goes to the divDebug panel _debug.setOutput("divDebug"); // *** Write some debug output _debug.writeLn("Color me purple");

Class Members

clear Clears the output buffer and if set the target output control.
output Writes the specified output into the debug buffer and output window. This method overrides any existing debug content.
setOutput Determines where debug output is sent to. By default debug output is created into a string which can be retrieved with toString(). Calling setOutput() also writes any new debug output directly into an HTML element's innerHTML.
toString Returns the generated debug output buffer.
write Writes the specified message to the debug output. Output goes to an additive buffer and if a setOutput was called also echos to the output target control.
writeLn Like the write method but adds a <br/> at the end of the message.


See also:

Class wwDebug

  Last Updated: 9/8/2007 | © West Wind Technologies, 2008