Open terminal and copy-past the command 🤝
npm i switch-log
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')
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
});