[issue #38] Fix the default bunyan
CLI output of a req.body
that is an object instead of a string.
This commit is contained in:
parent
8d431c4679
commit
ee6714b568
2 changed files with 6 additions and 3 deletions
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
## bunyan 0.13.4 (not yet released)
|
## bunyan 0.13.4 (not yet released)
|
||||||
|
|
||||||
(nothing yet)
|
- [issue #38] Fix the default `bunyan` CLI output of a `req.body` that is an
|
||||||
|
object instead of a string.
|
||||||
|
|
||||||
|
|
||||||
## bunyan 0.13.3
|
## bunyan 0.13.3
|
||||||
|
|
|
@ -628,7 +628,8 @@ function emitRecord(rec, line, opts, stylize) {
|
||||||
delete req.httpVersion;
|
delete req.httpVersion;
|
||||||
delete req.headers;
|
delete req.headers;
|
||||||
if (req.body) {
|
if (req.body) {
|
||||||
s += '\n\n' + req.body;
|
s += '\n\n' + (typeof(req.body) === 'object'
|
||||||
|
? JSON.stringify(req.body, null, 2) : req.body);
|
||||||
delete req.body;
|
delete req.body;
|
||||||
}
|
}
|
||||||
if (req.trailers && Object.keys(req.trailers) > 0) {
|
if (req.trailers && Object.keys(req.trailers) > 0) {
|
||||||
|
@ -669,7 +670,8 @@ function emitRecord(rec, line, opts, stylize) {
|
||||||
delete client_req.url;
|
delete client_req.url;
|
||||||
delete client_req.httpVersion;
|
delete client_req.httpVersion;
|
||||||
if (client_req.body) {
|
if (client_req.body) {
|
||||||
s += '\n\n' + client_req.body
|
s += '\n\n' + (typeof(client_req.body) === 'object'
|
||||||
|
? JSON.stringify(client_req.body, null, 2) : client_req.body);
|
||||||
delete client_req.body;
|
delete client_req.body;
|
||||||
}
|
}
|
||||||
// E.g. for extra 'foo' field on 'client_req', add 'client_req.foo' at
|
// E.g. for extra 'foo' field on 'client_req', add 'client_req.foo' at
|
||||||
|
|
Loading…
Reference in a new issue