A singleton class that implements a simple console.
mxLog | A singleton class that implements a simple console. |
Variables | |
consoleName | Specifies the name of the console window. |
TRACE | Specified if the output for enter and leave should be visible in the console. |
DEBUG | Specifies if the output for debug should be visible in the console. |
WARN | Specifies if the output for warn should be visible in the console. |
buffer | Buffer for pre-initialized content. |
Functions | |
init | Initializes the DOM node for the console. |
info | Writes the current navigator information to the console. |
addButton | Adds a button to the console using the given label and function. |
isVisible | Returns true if the console is visible. |
show | Shows the console. |
setVisible | Shows or hides the console. |
enter | Writes the specified string to the console if TRACE is true and returns the current time in milliseconds. |
leave | Writes the specified string to the console if TRACE is true and computes the difference between the current time and t0 in milliseconds. |
debug | Adds all arguments to the console if DEBUG is enabled. |
warn | Adds all arguments to the console if WARN is enabled. |
write | Adds the specified strings to the console. |
writeln | Adds the specified strings to the console, appending a linefeed at the end of each string. |
Specifies if the output for debug should be visible in the console. Default is true.
Specifies if the output for warn should be visible in the console. Default is true.
init: function()
Initializes the DOM node for the console. This requires document.body to point to a non-null value. This is called from within setVisible if the log has not yet been initialized.
enter: function( string )
Writes the specified string to the console if TRACE is true and returns the current time in milliseconds.
mxLog.show(); var t0 = mxLog.enter('Hello'); // Do something mxLog.leave('World!', t0);
debug: function()
Adds all arguments to the console if DEBUG is enabled.
mxLog.show(); mxLog.debug('Hello, World!');
warn: function()
Adds all arguments to the console if WARN is enabled.
mxLog.show(); mxLog.warn('Hello, World!');
Writes the specified string to the console if TRACE is true and returns the current time in milliseconds.
enter: function( string )
Writes the specified string to the console if TRACE is true and computes the difference between the current time and t0 in milliseconds.
leave: function( string, t0 )
Adds all arguments to the console if DEBUG is enabled.
debug: function()
Adds all arguments to the console if WARN is enabled.
warn: function()
Initializes the DOM node for the console.
init: function()
Writes the current navigator information to the console.
info: function()
Adds a button to the console using the given label and function.
addButton: function( lab, funct )
Returns true if the console is visible.
isVisible: function()
Shows the console.
show: function()
Shows or hides the console.
setVisible: function( visible )
Adds the specified strings to the console.
write: function()
Adds the specified strings to the console, appending a linefeed at the end of each string.
writeln: function()