@aantthony/logger

1.1.1 • Public • Published

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);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @aantthony/logger

Weekly Downloads

4

Version

1.1.1

License

MIT

Last publish

Collaborators

  • aantthony