feat: Implement structured logging and replace prints#17
Open
qyzl7 wants to merge 1 commit intoYuanchenBei:mainfrom
Open
feat: Implement structured logging and replace prints#17qyzl7 wants to merge 1 commit intoYuanchenBei:mainfrom
qyzl7 wants to merge 1 commit intoYuanchenBei:mainfrom
Conversation
- Add `logger.py` to configure console and file handlers. - Initialize logger in `main.py` with dynamic log paths. - Migrate `print` statements to `logger.info` in `main.py`, `BaseRecommender.py` and `GAR.py`. - Implement a global hook to log unhandled exceptions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR introduces a
loggingto output information to both the console and a file.As an initial implementation, I have migrated the
print()tologger.info()in the following files:main.pyBaseRecommender.pyGAR.pyNext Steps / To-Do:
print()statements in other model files still need to be replaced with the new logging system.param_search.py, will also require the addition of the logger initialization code to enable logging.The first work for #13
Changes
logger.pyto configure console and file handlers.main.pywith dynamic log paths.printstatements tologger.infoinmain.py,BaseRecommender.pyandGAR.py.