Draft: Add logging system #125
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds a logging system for synchronous and asynchronous logging. It is designed to be easily enhanced by a translator (i18n) and an issue tracker by using a protocols pattern. A structured logger along with different file formatters and log rotation are readily available. Refer to the provided README.md for an overview of features and how to use it.
Formatting changes: logging & Internationalizierung
Updated all logger calls to structured format with translate=True; all ConfigurationError messages wrapped with _() using named parameters; added exc_info=True to all error logs; renamed loop variables from _ to _idx to avoid shadowing i18n function
Added logging to validate() method; translated all ValidationIssue messages and print_summary messages with _(); added exc_info=True to error logs
Related Issues/Tickets
#84
Type of Change
How Has This Been Tested?
Unit tests have to be added to ensure a coverage of 100% taking also edge cases into account.
Checklist
uv run ruff format . && uv run ruff check .)uv run pytest)Additional Notes
The logger can make use of the i18n system provided in #119. Currently the validation of the configuration context has an own implementaiton of error handling and validation stacking. This will be tackled in another PR