Log primitive response values

This commit is contained in:
Andrew Ferrazzutti 2022-05-16 00:10:08 -04:00
parent 1897c1e494
commit bb9cdbd15e
2 changed files with 3 additions and 1 deletions

View File

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

View File

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