Tampered Console
Version 2
Version 2
  • Package Overview
  • Installation
  • Usage
    • Usage Overview
    • Global Console
      • Options
  • Features
  • Namespace
  • Debug
  • Formatting
  • Inspect
  • Acknowledgement
    • Depedencies
  • GitHub
    • Repository
    • Report Issues
  • License
Powered by GitBook
On this page
  • Default Configurations
  • Boolean
  • String
  • Object

Was this helpful?

  1. Usage
  2. Global Console

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

Passing 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); // reset

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.

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.

const Console = require('tampered-console');
Console.globalConsole({ namespace: true });

console.log('namespace')(args);

The fancy property is set to true by default if the this is enabled.

PreviousGlobal ConsoleNextNamespace

Last updated 3 years ago

Was this helpful?