Console API Reference

The console module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers.

Methods

The Console API provides the following methods:

log

console.log("Hello", "World");

Prints a message to the console.

debug

console.debug("Hello", "World");

Prints a message to the console with the log level set to Debug.

warn

console.warn("Hello", "World");

Prints a message to the console with the log level set to Warn.

error

console.error("Hello", "World");

Prints a message to the console with the log level set to Error.

info

console.info("Hello", "World");

Prints a message to the console with the log level set to Info.

assert

console.assert(true, "Hello", "World");

Prints a message to the console with the log level set to Error if the first argument is false.

clear

console.clear();

Clears the console.