node-bunyan-lite/examples/unstringifyable.js

13 lines
313 B
JavaScript
Raw Normal View History

// See how bunyan behaves with an un-stringify-able object.
var bunyan = require('../lib/bunyan');
var log = bunyan.createLogger({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