Remove logging
bcb opened this issue · 5 comments
This is overly complicated and non-standard.
The caller can add log handlers. The library shouldn’t add any.
The caller can do all the logging.
I agree! The log handlers were the only grievance I had with jsonrpcserver but a surprisingly big one.
I didn't really figure out a simple way to silence the logging which interfered with my own server logging and gave me a great deal of confusion as I was also logging the requests/responses on my own...
Furthermore, converting a (complex) JSON object into a string isn't without a performance cost which might be critical for a server - I think that is always happening ATM, regardless of logging settings. Yet another reason to leave the logging on the caller as you suggest.
I wouldn't mind doing some nuking... Do I understand correctly the goal is to remove all logging functionality?
I was planning to only remove the log handlers, leaving the caller to add handlers to the jsonrpcserver loggers. But I think you're right, there's no need to log at all. The caller can do all the logging.
I've updated the issue to remove all logging.
Complete in version 5
Worth mentioning - logging the requests and responses has been removed in version 5, but there are a couple of points where it still logs.
If the “method” (written by the user) has an uncaught exception, jsonrpcserver will log the exception and return a json-rpc Internal error response.
If jsonrpcserver itself has an exception, it will log the exception and return a json-rpc Server error response.