rework so that res and client_res can coexist

This commit is contained in:
Mark Cavage 2013-04-04 23:57:17 +00:00
parent e2100e0468
commit ec3be9fc94

View file

@ -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;