0.2.0 • Published 5 years ago

bunyan-console-log v0.2.0

Weekly downloads
109
License
MIT
Repository
github
Last release
5 years ago

bunyan-console-log

Minimal Bunyan stream like console.log that pretty prints output

var bunyan = require('bunyan');
var stream = require('bunyan-console-log')({
  printJSON: false,
  compact: false,
  colors: true
});

var options = {
  name: "example",
  streams: [{
    level: 'info',
    stream: stream
  }]
};
var logger = bunyan.createLogger(options);

logger.info({
  meta: {
    when: "now"
  },
  data: {
    hello: "world"
  }
}, "Example label");

Example output:

Example label { data: { hello: 'world' } }

Installation

$ npm install bunyan-console-log