Broken out from bug 7636, but affects more things than just asyncio. Several modules inside the Python standard library (asyncio and multiprocessing for example) use logging internally somewhat arbitrarily. This means that we currently don't have any control over how this logging gets done, such as how to format it, to which file things get logged, and which logging level should be used. Examples with further details can be seen in bug 7636 comment #32, bug 7636 comment #34, bug 7636 comment #44. I had a very brief look and saw that the modules that *might* cause incorrect logging are: * asyncio * concurrent.futures * http * lib2to3 * multiprocessing * site-packages (several sub packages) * venv From what I've seen during development, only logging from asyncio has been causing issues, but the problem is a more general one.
It seems like logging.captureWarnings(bool) [1] can be used to redirect warnings to the logging module instead. We might be able to use this to kill two birds with one stone (bug 8257). [1] https://docs.python.org/3/library/logging.html#logging.captureWarnings