diff --git a/node/README.md b/node/README.md index 9419caf..0d2aa89 100644 --- a/node/README.md +++ b/node/README.md @@ -8,3 +8,5 @@ If `type` is `tcp`, `port` and `host` are the host/port where to listen. ### Logging config `logging_keys` specifies which properties of RPC request & response objects to print in logs. Optional. + +A special-case logging key for responses is `value`, which enables logging responses that are primitives instead of objects. diff --git a/node/src/client.js b/node/src/client.js index 1398fdf..d29791e 100644 --- a/node/src/client.js +++ b/node/src/client.js @@ -1322,7 +1322,7 @@ export default class PeerClient { logger( `Response ${resp.id}:`, this.#logObj( - resp.response, + resp.response instanceof Object ? resp.response : {value: resp.response}, success ? "success" : "failure", this.loggingKeys.response )