bunyan CLI should format client_res (restify object)
This commit is contained in:
parent
6841b8c184
commit
e2100e0468
1 changed files with 8 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
// -*- mode: js -*-
|
||||||
//
|
//
|
||||||
// bunyan -- filter and pretty-print JSON logs, like Bunyan logs.
|
// bunyan -- filter and pretty-print JSON logs, like Bunyan logs.
|
||||||
//
|
//
|
||||||
|
@ -829,9 +830,13 @@ function emitRecord(rec, line, opts, stylize) {
|
||||||
details.push(indent(s));
|
details.push(indent(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec.res && typeof (rec.res) === 'object') {
|
if ((rec.res && typeof (rec.res) === 'object') ||
|
||||||
var res = rec.res;
|
(rec.client_res && typeof (rec.client_res) === 'object')) {
|
||||||
|
var res = rec.res || rec.client_res;
|
||||||
|
if (rec.res)
|
||||||
delete 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();
|
||||||
|
|
Loading…
Reference in a new issue