Skip to content

Conversation

@harryswift01
Copy link
Contributor

Summary

This PR standardizes logging behavior across CodeEntropy, ensuring consistency in log level handling, including logging from MDAnalysis. It also improves maintainability by enforcing proper configuration in the logger update logic.

Changes

Align log file level with logger configuration

  • Updated the program.log file handler to dynamically reflect the log_level provided during initialization.
  • Prevents defaulting to verbose logging unless explicitly requested.

Match MDAnalysis logging level with application log level

  • Applied the main log level to the MDAnalysis logger during configuration.
  • Helps ensure third-party logging is consistent with CodeEntropy verbosity.

Enforce logger and handler level updates in update_logging_level

  • Improved the update_logging_level method to update both logger levels and their attached handlers.
  • Guarantees runtime log level changes are respected uniformly.

Impact

  • Logging configuration is now more reliable and consistent across CodeEntropy.
  • Cleaner .log files by avoiding unnecessary verbosity.
  • Easier debugging and log filtering for both internal and third-party modules.
  • Better separation of error, debug, and standard output streams in production environments.

- Ensured the `.log` file is set to the same level as the logger, not just verbose
- MDAnalysis logging levels are the same as the ones used in CodeEntropy
- Ensure the correct setting of the logger is enforced in the `update_logging_level` function
@harryswift01 harryswift01 requested a review from jimboid May 13, 2025 14:21
@harryswift01 harryswift01 self-assigned this May 13, 2025
@harryswift01 harryswift01 linked an issue May 13, 2025 that may be closed by this pull request
3 tasks
Copy link
Member

@jimboid jimboid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@harryswift01 harryswift01 merged commit b29d984 into main May 13, 2025
5 of 6 checks passed
@harryswift01 harryswift01 deleted the 89-refine-output-log-generation branch May 14, 2025 10:25
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.

Refine Output Log Generation

3 participants