Class R.debug.Console
A class for logging messages to a console reference object. There are currently four supported console references:
- Firebug - logs to the Firebug/Firebug Lite error console
- OperaConsoleRef - logs to the Opera error console
- HTMLConsoleRef - logs to an HTML div element in the body
- SafariConsoleRef - logging for Apple's Safari browser
Defined in: debug.console.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
Output warnings, errors, and debug messages to the console.
|
|
Output only errors to the console.
|
|
Output warnings, errors, debug, and low-level info messages to the console.
|
|
Output nothing to the console.
|
|
Output all messages to the console.
|
|
Output warnings and errors to the console.
|
Method Attributes | Method Name and Description |
---|---|
debug()
Outputs a debug message.
|
|
error()
Output an error message.
|
|
Get the debug level which the console is currently at.
|
|
info()
Outputs an info message.
|
|
log()
Outputs a log message.
|
|
setConsoleRef(refObj)
Set the console reference object to a new type of console which isn't
natively supported.
|
|
setDebugLevel(level)
Set the debug output level of the console.
|
|
startup()
Starts up the console.
|
|
warn()
Outputs a warning message.
|
Field Detail
DEBUGLEVEL_DEBUG
Output warnings, errors, and debug messages to the console.
DEBUGLEVEL_ERRORS
Output only errors to the console.
DEBUGLEVEL_INFO
Output warnings, errors, debug, and low-level info messages to the console.
DEBUGLEVEL_NONE
Output nothing to the console.
DEBUGLEVEL_VERBOSE
Output all messages to the console.
DEBUGLEVEL_WARNINGS
Output warnings and errors to the console.
Method Detail
debug()
Outputs a debug message. These messages will only show when DEBUGLEVEL_DEBUG is the level.
You can pass as many parameters as you want to this method. The parameters will be combined into
one message to output to the console.
error()
Output an error message. These messages always appear unless the debug level is explicitly
set to DEBUGLEVEL_NONE.
You can pass as many parameters as you want to this method. The parameters will be combined into
one message to output to the console.
{Number}
getDebugLevel()
Get the debug level which the console is currently at.
- Returns:
- {Number} The debug level
info()
Outputs an info message. These messages will only show when DEBUGLEVEL_INFO is the level.
You can pass as many parameters as you want to this method. The parameters will be combined into
one message to output to the console.
log()
Outputs a log message. These messages will only show when DEBUGLEVEL_VERBOSE is the level.
You can pass as many parameters as you want to this method. The parameters will be combined into
one message to output to the console.
setConsoleRef(refObj)
Set the console reference object to a new type of console which isn't
natively supported.
- Parameters:
- refObj
- {ConsoleRef} A descendent of the ConsoleRef class.
setDebugLevel(level)
Set the debug output level of the console. The available levels are:
- Console.DEBUGLEVEL_ERRORS = 4
- Console.DEBUGLEVEL_WARNINGS = 3
- Console.DEBUGLEVEL_DEBUG = 2
- Console.DEBUGLEVEL_INFO = 1
- Console.DEBUGLEVEL_VERBOSE = 0
- Console.DEBUGLEVEL_NONE = -1
- Parameters:
- level
- {Number} One of the debug levels. Defaults to DEBUGLEVEL_NONE.
startup()
Starts up the console.
warn()
Outputs a warning message. These messages will only show when DEBUGLEVEL_WARNINGS is the level.
You can pass as many parameters as you want to this method. The parameters will be combined into
one message to output to the console.