ric-utils-logger
v1.0.9
Published
Console logger utility
Downloads
19
Readme
ric-utils-logger
Install
npm i --save-dev ric-utils-logger
npm shrinkwrap
Basic usage
const logger = require('ric-utils-logger')
logger.warn('warn message');
logger.info('info message');
logger.info({a: 1, b: 2});
logger.error('error message');
logger.error(new Error('error'));
Log level
setLogLevel(level : number|string );
logger.setLogLevel(0); // [none] silent mode ()
logger.setLogLevel(1); // [error] logs only error messages
logger.setLogLevel(2); // [warn] logs errors and warns
logger.setLogLevel(3); // [info] logs errors, warns and information messages
logger.setLogLevel(4); // [debug] logs all messages