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 configPassing false as an argument will remove the override and use return the global console back to default.
const Console = require('tampered-console');
Console.globalConsole(false); // resetString
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.
This property should be a boolean or a string, otherwise concatenated. If set to true the console method will return a function which has to be invoked.
The fancy property is set to true by default if the this is enabled.
Last updated
Was this helpful?