I am using hypercorn in my application with the Python API rather than the command line. How can I integrate hypercorn's logging into an existing python logging hierarchy? From looking at the source of logging.py, there is no way for hypercorn to create only the Logger objects without the Handler objects.
It is not the responsibility of a library to create and manage logging Handlers -- this is the job of the top-level application to control, which all dependent library's will adopt. So it makes sense for hypercorn to create the Handlers when using the command line since it is the top-level application. But when importing it into a Python application, it should only create the Loggers and not the Handlers, so that all log messages from the entire application share the same setup.
How can this be achieved?
I am using hypercorn in my application with the Python API rather than the command line. How can I integrate hypercorn's logging into an existing python logging hierarchy? From looking at the source of logging.py, there is no way for hypercorn to create only the Logger objects without the Handler objects.
It is not the responsibility of a library to create and manage logging Handlers -- this is the job of the top-level application to control, which all dependent library's will adopt. So it makes sense for hypercorn to create the Handlers when using the command line since it is the top-level application. But when importing it into a Python application, it should only create the Loggers and not the Handlers, so that all log messages from the entire application share the same setup.
How can this be achieved?