This pull request refactors and improves the logging and error handling in the ape-common library. The main changes include:
Enhanced error handling in the Evaluate class (evaluate.py):
Replaced outputs with example in the EvaluationResult returned on error.
Significant refactoring of the logging system (logging.py):
Removed custom TypedBoundLogger class in favor of standard structlog.stdlib.BoundLogger.
Introduced LOGGER_NAME constant for consistent logger naming.
Improved logging configuration for better customization and readability.
Added _create_rich_renderer method for custom log formatting.
Updated LogSettings class to use the new configuration.
Version bump:
Updated version to 0.1.4 in pyproject.toml.
Notes: The changes aim to improve the logging system's flexibility and readability. The new _create_rich_renderer method allows for custom log formatting, potentially reducing redundant information in log outputs. The version bump to 0.1.4 likely represents these logging improvements and minor refactoring.
Changes that Break Backward Compatibility
The removal of the custom TypedBoundLogger class and the switch to structlog.stdlib.BoundLogger may potentially break backward compatibility for code that explicitly relied on the custom logger implementation. Users of the library may need to update their code if they were directly using any methods or attributes specific to the removed TypedBoundLogger class.
Description
This pull request refactors and improves the logging and error handling in the
ape-common
library. The main changes include:Enhanced error handling in the
Evaluate
class (evaluate.py
):outputs
withexample
in theEvaluationResult
returned on error.Significant refactoring of the logging system (
logging.py
):TypedBoundLogger
class in favor of standardstructlog.stdlib.BoundLogger
.LOGGER_NAME
constant for consistent logger naming._create_rich_renderer
method for custom log formatting.LogSettings
class to use the new configuration.Version bump:
0.1.4
inpyproject.toml
.Notes: The changes aim to improve the logging system's flexibility and readability. The new _create_rich_renderer method allows for custom log formatting, potentially reducing redundant information in log outputs. The version bump to 0.1.4 likely represents these logging improvements and minor refactoring.
Changes that Break Backward Compatibility
The removal of the custom
TypedBoundLogger
class and the switch tostructlog.stdlib.BoundLogger
may potentially break backward compatibility for code that explicitly relied on the custom logger implementation. Users of the library may need to update their code if they were directly using any methods or attributes specific to the removedTypedBoundLogger
class.Documentation
N/A
Created with Palmier