Commonly used node functionality
$ npm install --save common-nodeutils
- LOGGER
var commonNodeutils = require('common-nodeutils');
var filename = 'logs/tests.log';
logger = commonNodeutils.logger('test', filename);
logger.info('testing 123');
logger.warn('testing 123');
logger.error('testing 123');
logger.fatal('testing 123');
logger.setLevel('DEBUG');
logger.debug('testing 123');
[2016-03-15 19:11:59.726] INFO test testing 123
[2016-03-15 19:11:59.729] WARN test testing 123
[2016-03-15 19:11:59.729] ERROR test testing 123
[2016-03-15 19:11:59.729] FATAL test testing 123
[2016-03-15 19:11:59.729] DEBUG test testing 123
MIT © Fritz G. Batroni