rework so that res and client_res can coexist
This commit is contained in:
parent
e2100e0468
commit
ec3be9fc94
1 changed files with 10 additions and 7 deletions
17
bin/bunyan
17
bin/bunyan
|
@ -830,13 +830,7 @@ function emitRecord(rec, line, opts, stylize) {
|
|||
details.push(indent(s));
|
||||
}
|
||||
|
||||
if ((rec.res && typeof (rec.res) === 'object') ||
|
||||
(rec.client_res && typeof (rec.client_res) === 'object')) {
|
||||
var res = rec.res || rec.client_res;
|
||||
if (rec.res)
|
||||
delete rec.res;
|
||||
if (rec.client_res)
|
||||
delete rec.client_res;
|
||||
function _res(res) {
|
||||
var s = '';
|
||||
if (res.header) {
|
||||
s += res.header.trimRight();
|
||||
|
@ -872,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;
|
||||
|
|
Loading…
Reference in a new issue