Closed piedenis closed 7 years ago
I propose to use a DEBUG logging level for that.
Strike that, I added a property trace
to RPCServer
.
When it is set to a callable after constructing RPCServer
it will get called with three parameters:
So your trace code could look like:
def my_trace(direction, context, message):
logger.debug('%s%s', direction, message)
server = RPCServer(transport, protocol, dispatcher)
server.trace = my_trace
server.serve_forever()
tinyrpc is very nice for abstracting RPC between a Python client and a Python server. It's great because I don't have to care about underlying JSON objects. However, I have to create now a JSON-RPC Python server for a JSON-RPC Java client. For debugging purpose, is it possible to trace the JSON objects received and emitted by tinyrpc? How can I do that?