0.1.4 • Published 10 years ago

bunyan-promise v0.1.4

Weekly downloads
12
License
-
Repository
github
Last release
10 years ago

Bunyan-Promise

Bunyan-Promise can consume any type of promises, but for the sake of this example we'll use one from Kriskowal's Q Library.

var q = require('q');
var BunyanPromiseLogger = require('bunyan-promise');
var logger = new BunyanPromiseLogger({
  name: 'test-logger'
});
var defer = q.defer();
logger.trace(defer.promise, 'arbitrary promise name for logging');

// sometime in the future resolve that promise
setTimeout(function () {
  defer.resolve();
}, 10000);

Example output

This is pretty printed by piping the output through the bunyan cli.

node app.js | bunyan -o short

Alternatively you can use the bunyan grunt task if you're using grunt

npm install --save-dev grunt-bunyan
grunt bunyan task1 task2 ...

npm.io

0.1.4

10 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago