ongoworks:bunyan-logger

v1.0.0Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Implements the Bunyan logging module for Meteor

`meteor add ongoworks:bunyan`

Also adds bunyan-pretty for pretty-printed bunyan Meteor console output.

The package exports logger.bunyan and logger.bunyanPretty.

logger = {};
logger.bunyan = Npm.require('bunyan');
logger.bunyanPretty = Npm.require('bunyan-pretty');

Example pure bunyan implementation in your application:

log = logger.bunyan.createLogger({name:'your-app'});

Example bunyan-pretty implemention in your application as:

log = logger.bunyan.createLogger({
  name: 'your-app',
  stream: process.stdout.isTTY ? logger.bunyanPretty() : process.stdout,
  level: 'info'
})

And add logging:

log.info("Something informative");