Global object “console”
The console object provides access to the debugging console.
Type: | Console extends Object |
Constructor: | private |
Singleton: | console |
Namespace: | global |
Direct subclasses: | None |
JSX Support: | No |
Examples
JavaScript
console.log('message');
console.error('error');
console.trace();
console.dirxml({});
See also:
JSX Logging to the console
with various log levels
Methods
assert(expression, …values)
Outputs an error message to the console if the first argument is false.
Parameter | Type | Description |
---|---|---|
expression | boolean |
Any boolean expression. If the assertion is false, the error message is written to the console. |
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined
count(label?)
Logs the number of times that this particular call to count() has been called.
Parameter | Type | Description |
---|---|---|
label | string |
If supplied, count() outputs the number of times it has been called with that label. Optional. |
Returns: undefined
countReset(label?)
Resets the counter.
Parameter | Type | Description |
---|---|---|
label | string |
If label supplied, this function resets the count associated with that particular label. Optional. |
Returns: undefined
debug(…values)
Outputs a debug message to the console.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined
dirxml(object)
XML tree representation of a given object, if available. Supported types include all widgets and localStorage
.
*The output is NOT JSX, it is a human-readable summary that displays XML-conforming string representations of some select property values.
Parameter | Type | Description |
---|---|---|
object | any |
A JavaScript object |
Returns: undefined
error(…values)
Outputs an error message to the console.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined
group(…values)
Creates a new inline group in the console output. This indents following console messages by an additional spaces, until console.groupEnd() is called.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined
groupEnd()
Exits the current inline group in the console.
Returns: undefined
groupEnd()
Exits the current inline group in the console.
Returns: undefined
info(…values)
Outputs an info message to the console.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined
log(…values)
Outputs a message to the console.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output |
Returns: undefined
trace()
Prints a stack trace in a platform-independent format. Framework internals are omitted.
Source maps are supported when side-loading code via the tabris CLI.
Returns: undefined
warn(…values)
Outputs a warning message to the console.
Parameter | Type | Description |
---|---|---|
…values | any[] |
A list of JavaScript values to output. |
Returns: undefined