spencern / meteor-bunyan

Meteor package that supplies Bunyan

Home Page:https://atmospherejs.com/ongoworks/bunyan-logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add and export the Bunyan logging module, also add the browserify client and bunyan-pretty.

`meteor add ongoworks:bunyan-logger`

Adds bunyan-pretty for pretty-printed bunyan Meteor output.

Server

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

Client

The package exports bunyan to the client.

var log = bunyan.createLogger({name: 'play', level: 'debug'});
log.trace('this one does not emit');
log.debug('hi on debug');   // console.log

About

Meteor package that supplies Bunyan

https://atmospherejs.com/ongoworks/bunyan-logger


Languages

Language:JavaScript 100.0%