From 5f9cdc3e989b0a7bfa4fe9433a92938aa9e4efe6 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 24 Oct 2012 10:54:18 -0700 Subject: [PATCH] export bunyan.safeCycles --- CHANGES.md | 5 +++++ lib/bunyan.js | 5 +++++ 2 files changed, 10 insertions(+) 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;