Log primitive response values
This commit is contained in:
parent
1897c1e494
commit
bb9cdbd15e
|
@ -8,3 +8,5 @@ If `type` is `tcp`, `port` and `host` are the host/port where to listen.
|
||||||
|
|
||||||
### Logging config
|
### Logging config
|
||||||
`logging_keys` specifies which properties of RPC request & response objects to print in logs. Optional.
|
`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.
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ export default class PeerClient {
|
||||||
logger(
|
logger(
|
||||||
`Response ${resp.id}:`,
|
`Response ${resp.id}:`,
|
||||||
this.#logObj(
|
this.#logObj(
|
||||||
resp.response,
|
resp.response instanceof Object ? resp.response : {value: resp.response},
|
||||||
success ? "success" : "failure",
|
success ? "success" : "failure",
|
||||||
this.loggingKeys.response
|
this.loggingKeys.response
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue