switch-log
v1.0.2
Published
A logger library, where you can enable or disable logging based on env (dev/prod or as you wish)
Downloads
8
Readme
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
});