node-bunyan-lite/examples/unstringifyable.js

13 lines
304 B
JavaScript
Raw Permalink Normal View History

// See how bunyan behaves with an un-stringify-able object.
2012-06-05 06:19:39 +00:00
var Logger = require('../lib/bunyan');
2012-06-05 06:19:39 +00:00
var log = new Logger({src: true, name: 'foo'});
// Make a circular object (cannot be JSON-ified).
var myobj = {
2013-03-29 00:42:32 +00:00
foo: 'bar'
};
myobj.myobj = myobj;
2012-06-05 06:19:39 +00:00
log.info({obj: myobj}, 'hi there'); // <--- here