diff --git a/CHANGES.md b/CHANGES.md index 9149843..25dbbb8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ ## bunyan 0.14.6 (not yet released) +- Export `bunyan.safeCycles()`. This may be useful for custom `type == "raw"` + streams that may do JSON stringification of log records themselves. Usage: + + var str = JSON.stringify(rec, bunyan.safeCycles()); + - [issue #49] Allow a `log.child()` to specify the level of inherited streams. For example: diff --git a/lib/bunyan.js b/lib/bunyan.js index 968f1ec..9a3b802 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -917,3 +917,8 @@ module.exports.createLogger = function createLogger(options) { }; module.exports.RingBuffer = RingBuffer; + +// Useful for custom `type == "raw"` streams that may do JSON stringification +// of log records themselves. Usage: +// var str = JSON.stringify(rec, bunyan.safeCycles()); +module.exports.safeCycles = safeCycles;