Skip to content

Commit 66b247a

Browse files
matthieusiebenmonkpow
authored andcommitted
Fixed usage of JSON.stringify in debug (#400)
When debugging is disabled, calling `debug('', JSON.stringify())` will cause the data to be stringified even if debugging is disabled. The proper usage of the `debug` package requires to use `%o` or `%O` to pretty-print an object.
1 parent bf44d2b commit 66b247a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/steps/decorateProxyReqOpts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function decorateProxyReqOpt(container) {
1414
.then(function (processedReqOpts) {
1515
delete processedReqOpts.params;
1616
container.proxy.reqBuilder = processedReqOpts;
17-
debug('Request options (after processing):', JSON.stringify(processedReqOpts));
17+
debug('Request options (after processing): %o', processedReqOpts);
1818
return Promise.resolve(container);
1919
});
2020
}

0 commit comments

Comments
 (0)