ResponseContext(response, request, rpc_logger=None)¶
Helper to log gRPC request and response message to the data buffer for a service.
It should be called using a “with” statement each time an RPC is received such that the request and response proto messages can be passed in. It will automatically log the request and response to the data buffer, and mutates the headers to add additional information before logging.
response (protobuf) – any gRPC response message with a bosdyn.api.ResponseHeader proto.
request (protobuf) – any gRPC request message with a bosdyn.api.RequestHeader proto.
rpc_logger (DataBufferClient) – Optional data buffer client to log the messages; if not provided, only the headers will be mutated and nothing will be logged.