-
-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How best to implement a Logging Adapter? #140
Comments
The Dispatcher interface is a very close equivalent to the Adapter interface. You could achieve the same usage you’ve given an example of by subclassing the default Dispatch implementation (ConnectionPool), and passing it to the client with dispatch=. That’d be equivalent to how this example subclasses HTTPAdapter, and uses mount to add it to the client. |
Excellent. I'll give that a shot tomorrow. Thanks! |
This issue is no longer needed it seems? Reopen if I'm wrong here :) |
Yup, the custom Dispatcher worked for me, was going to update on Monday once I had a bit more testing done. Good to close 👍 |
I see that adapters were added, debated, and then removed for simplicities sake, but I'd like to set up a logging adapter like is possible by subclassing
requests.adapters.HTTPAdapter
like so:With httpx, would I need to wrap/subclass a
Dispatcher
orClient
class instead?The text was updated successfully, but these errors were encountered: