Class o2.Debugger
static
class
o2.Debugger
Checks the value of pass, and displays the message with a proper className.
The class name can be one of the Debugger.config.constants.className members.
Usage example:
o2.Debugger.assert((1==true), '1 == true');
Prints an error message to the output.
Usage example:
o2.Debugger.error('A serious error occured');
Prints an info message to the output.
Usage example:
o2.Debugger.info('An info.');
Initializes the Debugger static
class.
Either >outputElement>, or >shouldUseConsole, or both should be provided.
Usage example:
o2.Debugger.init('divConsole', true);
This is an alias to Debugger.println.
Simply logs a message.
Usage example:
o2.Debugger.log('Hello world');
Prints the string representation of value to the next line.
Usage example:
o2.Debugger.println('Hello world.');
Function Details
function assert
static
assert(Expression
pass, String
message)
Checks the value of pass, and displays the message with a proper className.
The class name can be one of the Debugger.config.constants.className members.
Usage example:
o2.Debugger.assert((1==true), '1 == true');
pass
- the expression to evaluate.
message
- the message to display. function error
static
error(String
message)
Prints an error message to the output.
Usage example:
o2.Debugger.error('A serious error occured');
message
- the error message to display. function info
static
info(String
message)
Prints an info message to the output.
Usage example:
o2.Debugger.info('An info.');
message
- the info message to display. function init
static
init(Object
outputElement, Boolean
shouldUseConsole)
Initializes the Debugger static
class.
Either >outputElement>, or >shouldUseConsole, or both should be provided.
Usage example:
o2.Debugger.init('divConsole', true);
outputElement
- Either the id of the
element, or the element itself to append debug messages.
shouldUseConsole
- should browser's built-in console
be used, if available. function log
static
log(String
message)
This is an alias to Debugger.println.
Simply logs a message.
Usage example:
o2.Debugger.log('Hello world');
message
- the message to log. function println
Prints the string representation of value to the next line.
Usage example:
o2.Debugger.println('Hello world.');
value
- the value to print.
className
- the CSS class name that is associated with
the line. function warn
static
warn(String
message)
Prints an warning message to the output.
Usage example:
o2.Debugger.warn('caution!');
message
- the warning message to display.
A static object for debugging purposes.
Usage example: