Global object “console”

Object > Console

The console object provides access to the debugging console

Console on Android
Android
Console on iOS
iOS
Constructor private
Singleton console
Namespace global
Direct subclasses None
JSX support No

Example

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 Optional Description
expression boolean No Any boolean expression. If the assertion is false, the error message is written to the console.
…values any[] No A list of JavaScript values to output.

Returns void

count(label?)

Logs the number of times that this particular call to count() has been called.

Parameter Type Optional Description
label string Yes If supplied, count() outputs the number of times it has been called with that label.

Returns void

countReset(label?)

Resets the counter.

Parameter Type Optional Description
label string Yes If label supplied, this function resets the count associated with that particular label.

Returns void

debug(…values)

Outputs a debug message to the console.

Parameter Type Optional Description
…values any[] No A list of JavaScript values to output.

Returns void

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 Optional Description
object any No A JavaScript object

Returns void

error(…values)

Outputs an error message to the console.

Parameter Type Optional Description
…values any[] No A list of JavaScript values to output.

Returns void

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 Optional Description
…values any[] No A list of JavaScript values to output.

Returns void

groupEnd()

Exits the current inline group in the console.

Returns void

groupEnd()

Exits the current inline group in the console.

Returns void

info(…values)

Outputs an info message to the console.

Parameter Type Optional Description
…values any[] No A list of JavaScript values to output.

Returns void

log(…values)

Outputs a message to the console.

Parameter Type Optional Description
…values any[] No A list of JavaScript values to output

Returns void

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 void

warn(…values)

Outputs a warning message to the console.

Parameter Type Optional Description
…values any[] No A list of JavaScript values to output.

Returns void