Type:
- object
Properties:
Name | Type | Description |
---|---|---|
OFF |
number | Logging is off. Value is 0. |
ERROR |
number | Error logging level. Value is 1. |
WARN |
number | Warning logging level. Value is 2. |
INFO |
number | Information logging level. Value is 4. |
APP_TRACE |
number | Application tracing logging level. Value is 6. |
ENGINE_TRACE |
number | Engine tracing logging level. Value is 9. |
Log an error message. The error function always writes the error, regardless of the log level from the server or set with apex.debug.setLevel. Messages are written using the browsers built-in console logging, if available. If supported, console.trace is called. Older browsers may not support the console object or all of its features.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Examples
apex.debug.error( "Update Failed" );
apex.debug.error( "Exception: ", ex );
Method that returns the debug log level.
The debug log level is synchronized with hidden input element #pdebug
.
In a developer session, the default log level is WARN.
Returns:
- Type
- number
Example
apex.debug.log( "Level=", apex.debug.getLevel() );
Log an informational message. Similar to apex.debug.message with the level set to INFO.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Example
apex.debug.info( "Command successful" );
Log a message. Similar to apex.debug.message with the level set to the highest level.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Example
apex.debug.log( "Level=", apex.debug.getLevel() );
Log a message at the given debug log level. The log level set from the server or with apex.debug.setLevel controls if the message is actually written. If the set log level is >= pLevel then the message is written. Messages are written using the browsers built-in console logging, if available. Older browsers may not support the console object or all of its features.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
pLevel |
number | A number from 1 to 9, where level 1 is most important, and level 9 is least important. Can be one of the apex.debug.LOG_LEVEL constants. Any other value such as 0 will turn off debug logging. | |
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Example
apex.debug.message( 7, "Testing" );
Method that sets the debug log level. Log messages at or below the specified level are written to the
console log. It is rarely necessary to call this function because the debug log level is
synchronized with the hidden input element #pdebug
that comes from the server.
Parameters:
Name | Type | Description |
---|---|---|
pLevel |
number | A number from 1 to 9, where level 1 is most important, and level 9 is least important. Can be one of the LOG_LEVEL constants. Any other value such as 0 will turn off debug logging. |
Example
apex.debug.setLevel( apex.debug.LOG_LEVEL.APP_TRACE );
Log a trace message. Similar to apex.debug.message with the level set to APP_TRACE.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Example
apex.debug.trace( "Got click event: ", event );
Log a warning message. Similar to apex.debug.message with the level set to WARN.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arguments |
* |
<repeatable> |
Any number of parameters which will be logged to the console. |
Example
apex.debug.warn( "Empty string ignored" );