var log = require('log4js-simple');
log.info('Hello %s', world);
log.warn('Hello %s', world);
log.error('Hello %s', world);
log.fatal('Hello %s', world);
/** ['ALL', 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL', 'OFF'] */
log.level = 3; // INFO;
var levels = ['ALL', 'INFO', 'WARN', 'ERROR'];
log.setLevels(levels [, level=2 [, displayCallstackLevel=2 [, displayErrorLevel=3]);
log.all('all message'); // Not display
log.warn('call stack display ...');
log.error('error message');
log.prefix = function(level) {
/** 2016-11-03T08:39:35.943Z INFO */
return (new Date()).toISOString() + ' ' + levels[level];
}
$ npm i log4js-simple