node-bunyan-lite/examples/unstringifyable.js

13 lines
302 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 = {
foo: 'bar'
};
myobj.myobj = myobj;
2012-06-05 06:19:39 +00:00
log.info({obj: myobj}, 'hi there'); // <--- here