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));
|
details.push(indent(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rec.res && typeof (rec.res) === 'object') ||
|
function _res(res) {
|
||||||
(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;
|
|
||||||
var s = '';
|
var s = '';
|
||||||
if (res.header) {
|
if (res.header) {
|
||||||
s += res.header.trimRight();
|
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) {
|
if (rec.err && rec.err.stack) {
|
||||||
details.push(indent(rec.err.stack));
|
details.push(indent(rec.err.stack));
|
||||||
delete rec.err;
|
delete rec.err;
|
||||||
|
|
Loading…
Reference in a new issue