Re-initializing the logger #2415
Unanswered
chbndrhnns
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom
HttpClientwhich wraps httpx and I have no control over the lifecycle of thatHttpClient.It seems that the logging setup for httpx takes place on the first import of something httpx-related. It happens that the environment variable which controls the logging for httpx is only available later after an
.envhas been read and populated in the environment.My question is now about re-initializing the logger:
I found an approach in the tests. It works but uses a private module and a private global variable which I'd prefer to avoid.
Is there a cleaner way of doing that that I am not aware of?
Beta Was this translation helpful? Give feedback.
All reactions