node-bunyan-lite/examples/unstringifyable.js
2012-06-04 23:19:39 -07:00

12 lines
302 B
JavaScript

// See how bunyan behaves with an un-stringify-able object.
var Logger = require('../lib/bunyan');
var log = new Logger({src: true, name: 'foo'});
// Make a circular object (cannot be JSON-ified).
var myobj = {
foo: 'bar'
};
myobj.myobj = myobj;
log.info({obj: myobj}, 'hi there'); // <--- here