Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

aantthony/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger

Simple console.log replacement.

npm install --save https://github.com/aantthony/logger/archive/v1.0.0.tar.gz

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

About

Simple console.log replacement

Resources

License

Stars

Watchers

Forks

Packages

No packages published