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
Additionally, this single hatchet logger is used throughout the library instead of module-local loggers.
Issues
Inflexible Logging Configuration: The current setup makes it difficult for users to opt out of or modify the logging behavior. This limits the flexibility for applications that may need different logging setups (e.g., logging to files, using structured logging, or integrating with specific logging services).
Single Logger Usage: Using a single hatchet logger throughout the library, instead of module-local loggers, makes it harder for users to have fine-grained control over logging from different parts of the library.
Proposed Changes
Optional Logging Configuration: Make the current logging setup optional, allowing users to easily opt out or configure their own logging setup. I would even be fine if it were enabled by default without an explicit opt out somehow.
Module-Local Loggers: Use module-local loggers (e.g., logging.getLogger(__name__)) throughout the library instead of a single hatchet logger.
Benefits
These changes would:
Provide more flexibility for users to integrate the library into their existing logging setups.
Allow for more fine-grained control over logging from different parts of the library.
Align with Python logging best practices for libraries.
Current Behavior
The library currently sets up logging configuration at the module level:
(here)
Additionally, this single
hatchet
logger is used throughout the library instead of module-local loggers.Issues
Inflexible Logging Configuration: The current setup makes it difficult for users to opt out of or modify the logging behavior. This limits the flexibility for applications that may need different logging setups (e.g., logging to files, using structured logging, or integrating with specific logging services).
Single Logger Usage: Using a single
hatchet
logger throughout the library, instead of module-local loggers, makes it harder for users to have fine-grained control over logging from different parts of the library.Proposed Changes
Optional Logging Configuration: Make the current logging setup optional, allowing users to easily opt out or configure their own logging setup. I would even be fine if it were enabled by default without an explicit opt out somehow.
Module-Local Loggers: Use module-local loggers (e.g.,
logging.getLogger(__name__)
) throughout the library instead of a singlehatchet
logger.Benefits
These changes would:
Example of Good Logging Practices
For reference, SQLAlchemy provides a good example of logging practices in a Python library:
https://docs.sqlalchemy.org/en/14/core/engines.html#configuring-logging
Possible Implementation
logging.getLogger("hatchet")
withlogging.getLogger(__name__)
.The text was updated successfully, but these errors were encountered: