diff --git a/bin/bunyan b/bin/bunyan index 8142e4e..ba176bb 100755 --- a/bin/bunyan +++ b/bin/bunyan @@ -1,4 +1,5 @@ #!/usr/bin/env node +// -*- mode: js -*- // // bunyan -- filter and pretty-print JSON logs, like Bunyan logs. // @@ -829,9 +830,7 @@ function emitRecord(rec, line, opts, stylize) { details.push(indent(s)); } - if (rec.res && typeof (rec.res) === 'object') { - var res = rec.res; - delete rec.res; + function _res(res) { var s = ''; if (res.header) { s += res.header.trimRight(); @@ -867,6 +866,15 @@ function emitRecord(rec, line, opts, stylize) { }); } + if (rec.res && typeof (rec.res) === 'object') { + _res(rec.res); + delete rec.res; + } + if (rec.client_res && typeof (rec.client_res) === 'object') { + _res(rec.client_res); + delete rec.res; + } + if (rec.err && rec.err.stack) { details.push(indent(rec.err.stack)); delete rec.err;