CodingSamrat / switch-log

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

switch-log

Installation

Open terminal and copy-past the command 🤝

npm i switch-log

Usage

import Log from 'switch-log'

// Create a log instance
const log = new Log();


// Use the logger
log.info('This is an info message')
log.warn('This is a warning message')
log.error('This is an error message')


Disable Log

If you want to disable logging you can pass options to Log.

import Log from 'switch-log'

// Create a log instance with options
const log = new Log({
    disabled:true // change condition according to you
});

About


Languages

Language:JavaScript 100.0%