1.0.1 • Published 2 years ago
jslogutils v1.0.1
JSLogUtils
A library that makes logging look better!
Installion
Install the library:
$ npm install jslogutils
# or
$ yarn add jslogutils
Import the library:
const JSLogUtils = require('JSLogUtils');
const logger = new JSLogUtils();
Examples
Simple logging:
logger.error('error');
logger.debug('debug');
logger.info('info');
logger.warning('warning');
Logging with prefix:
logger.setPrefix(JSLogUtils.PREFIX.ERROR, '[ERROR]');
logger.setPrefix(JSLogUtils.PREFIX.DEBUG, '[DEBUG]');
logger.setPrefix(JSLogUtils.PREFIX.INFO, '[INFO]');
logger.setPrefix(JSLogUtils.PREFIX.WARNING, '[WARNING]');