Skip to main content

Function: createConsole()

createConsole(opts): Console

Creates a custom console object.

Parameters

opts

clearConsole?

() => void

function to clear the console, e.g. send the ASCII ctrl character

formatter?

(args) => string

format given values, either by using a format string as first param or otherwise display values in a well readable format, see https://console.spec.whatwg.org/#formatter

inspect?

(args) => string

format js values to be well readable

logger?

(logLevel, args, options) => void

function to handle normal log messages, see https://console.spec.whatwg.org/#logger

printer

(logLevel, args, options) => void

function to print messages to somewhere, see https://console.spec.whatwg.org/#printer

Returns

Console