Repository navigation
Conversation
|
In the context of #676, I was thinking it could be even more flexible to add a That would solve your issue, wouldn't it? |
|
Yes I suppose it would be cleaner than my current solution where I'm loading the module, grabbing the logger, wrapping it in my own adapter and injecting it back into the module using |
|
OK As a first step, I'd rather allow users to provide their own loggers. That will be the most flexible. As a second stop, I may consider stronger integration with asyncio with contextvars. However, I'm currently working on untangling websockets from asyncio (in order to support other I/O libraries), so I would only consider this in the asyncio-specific part that remains after this refactoring. |
As discussed in #782, this would enable asyncio contextvars logging.
A task would set its context by invoking
websockets.utils.set_logging_contextvar("context...").