Options

Options for arguments passed to the override option.

The override option Console.globalConsole()can be invoked optionally with arguments passed. Invoking it without any arguments passed will override the global console with default configurations.

Default Configurations

The override options can be configured in with fancy and namespaceproperties. The table below shows the default value of these properties whenever the override option is called without any arguments.

Property

Type

Default Value

fancy

boolean

true

namespace

boolean | string

false

Boolean

Passing true as an argument will utilize the default configuration for the overrides. This is the same as calling the function without any arguments passed.

const Console = require('tampered-console');
Console.globalConsole(true); // default config

String

This defaults to true and adds a uniform namespace every time there is a console log.

const Console = require('tamepred-console');
Console.globalConsole('namespace');

Object

Passing an object gives you wider option as you can configure how the tampered-console should behave.

The fancy property is the primary option of Tampered Console. Its value must be a boolean, otherwise assumes true. This determines whether the package should add prefixes and suffixes to the console.

This property is set to true by default if the namespace property is enabled.

Last updated