@aantthony/logger
v1.1.1
Published
Simple console.log replacement
Downloads
8
Readme
logger
Simple console.log
replacement.
npm install --save @aantthony/logger
Usage
var log = require('logger')('Login');
// 9720ms Login: Hello World!
log.info('Hello World!');
Disable output
require('logger').setOutputStream(null);
Collect log data:
require('logger').on('data', function (payload) {
// { component: 'Login',
// time: Thu Jun 18 2015 23:09:29 GMT+1000 (AEST),
// hostname: 'Anthony.local',
// level: 'info',
// message: 'Hello World!',
// pid: 46297,
// data: undefined }
console.log(payload);
});