You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be interesting to see a proposed implementation for developers to use logbook for their own modules.
In the past I have used a modulename/log.py file which instantiates a Logger instance (disabled by default), with the other python files doing from .log import logger.
I think the real question is why nested loggers are used. It's usually not only to organize the names better - it's to reuse the handlers on the parent logger.
Logbook does not associate handlers for specific loggers, but rather chooses a centralized handler stack with multiple loggers writing to the same stack...
It would be interesting to see a proposed implementation for developers to use logbook for their own modules.
In the past I have used a modulename/log.py file which instantiates a Logger instance (disabled by default), with the other python files doing
from .log import logger
.For example, I'm trying to think how sqlalchemy would use Logbook rather than logging, since they make use of nested loggers quite well.
Would the logbook way be to have a Logger instance in sqlalchemy/engine and sqlalchemy/pool?
The text was updated successfully, but these errors were encountered: