Console

@native @JSType
trait Console extends Object

The console object provides access to the browser's debugging console. The specifics of how it works vary from browser to browser, but there is a de facto set of features that are typically provided.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def assert(test: Boolean, message: String, optionalParams: Any*): Unit
def clear(): Unit
def count(label: String): Unit

Logs the number of times that this particular call to count() has been called. This function takes an optional argument label.

Logs the number of times that this particular call to count() has been called. This function takes an optional argument label.

def countReset(label: String): Unit

Resets the counter. This function takes an optional argument label.

Resets the counter. This function takes an optional argument label.

def debug(message: Any, optionalParams: Any*): Unit

Outputs a debug message. You may use string substitution and additional arguments with this method. See Using string substitutions.

Outputs a debug message. You may use string substitution and additional arguments with this method. See Using string substitutions.

def dir(value: Any, optionalParams: Any*): Unit

Displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.

Displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.

def dirxml(value: Any): Unit

Displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.

Displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.

def error(message: Any, optionalParams: Any*): Unit

Outputs an error message. You may use string substitution and additional arguments with this method. See Using string substitutions.

Outputs an error message. You may use string substitution and additional arguments with this method. See Using string substitutions.

def group(label: UndefOr[String]): Unit

Creates a new inline group in the Web Console log. This indents following console messages by an additional level, until console.groupEnd() is called.

Creates a new inline group in the Web Console log. This indents following console messages by an additional level, until console.groupEnd() is called.

def groupCollapsed(label: UndefOr[String]): Unit

Creates a new inline group in the Web Console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.

Creates a new inline group in the Web Console. Unlike console.group(), however, the new group is created collapsed. The user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.

Call console.groupEnd() to back out to the parent group.

def groupEnd(): Unit

Exits the current inline group in the Web Console.

Exits the current inline group in the Web Console.

def info(message: Any, optionalParams: Any*): Unit

Outputs an informational message to the Web Console. In Firefox, a small "i" icon is displayed next to these items in the Web Console's log.

Outputs an informational message to the Web Console. In Firefox, a small "i" icon is displayed next to these items in the Web Console's log.

def log(message: Any, optionalParams: Any*): Unit

For general output of logging information. You may use string substitution and additional arguments with this method. See Using string substitutions.

For general output of logging information. You may use string substitution and additional arguments with this method. See Using string substitutions.

def profile(reportName: String): Unit
def profileEnd(): Unit
def table(data: Object | Array[_], columns: UndefOr[Int]): Unit

Displays tabular data as a table.

Displays tabular data as a table.

This function takes one mandatory argument data, which must be an array or an object, and one additional optional parameter columns.

It logs data as a table. Each element in the array (or enumerable property if data is an object) will be a row in the table.

The first column in the table will be labeled (index). If data is an array, then its values will be the array indices. If data is an object, then its values will be the property names. Note that (in Firefox) console.table is limited to displaying 1000 rows (first row is the labeled index).

def time(label: String): Unit

Starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.

Starts a timer you can use to track how long an operation takes. You give each timer a unique name, and may have up to 10,000 timers running on a given page. When you call console.timeEnd() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.

def timeEnd(label: String): Unit

Stops a timer that was previously started by calling console.time().

Stops a timer that was previously started by calling console.time().

def trace(): Unit

Outputs a stack trace to the Web Console.

Outputs a stack trace to the Web Console.

def warn(message: Any, optionalParams: Any*): Unit

Outputs a warning message. You may use string substitution and additional arguments with this method. See Using string substitutions.

Outputs a warning message. You may use string substitution and additional arguments with this method. See Using string substitutions.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object