Skip to content

feat: Implement structured logging and replace prints#17

Open
qyzl7 wants to merge 1 commit intoYuanchenBei:mainfrom
qyzl7:feat/logger
Open

feat: Implement structured logging and replace prints#17
qyzl7 wants to merge 1 commit intoYuanchenBei:mainfrom
qyzl7:feat/logger

Conversation

@qyzl7
Copy link
Contributor

@qyzl7 qyzl7 commented Aug 9, 2025

Summary

This PR introduces a logging to output information to both the console and a file.

As an initial implementation, I have migrated the print() to logger.info() in the following files:

  • main.py
  • BaseRecommender.py
  • GAR.py

Next Steps / To-Do:

  • The print() statements in other model files still need to be replaced with the new logging system.
  • Other entry point scripts, such as param_search.py, will also require the addition of the logger initialization code to enable logging.

The first work for #13

Changes

  • 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.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant