Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to per-module loggers #109

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Switch to per-module loggers #109

merged 2 commits into from
Sep 18, 2024

Conversation

Pennycook
Copy link
Contributor

Related issues

Pre-work for #108.

Switching to per-module loggers (which are best practice anyway) will allow us to separate preprocessor-related messages.

Proposed changes

  • Use __name__ to give each module its own logger.
  • Fix incorrect usage of the disabled property of each logger. Setting disabled directly is not allowed (see here) and doesn't propagate to child loggers.

This shouldn't change any behavior, because all loggers in the codebasin
package will inherit its configuration. However, having separate loggers
will allow us to configure different behavior for each module later.

Signed-off-by: John Pennycook <[email protected]>
The documentation for the logging module says that the disabled property
of a logger should be treated as read-only. The logging.disable()
function is the correct way to disable logging.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added bug Something isn't working enhancement New feature or request labels Sep 10, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Sep 10, 2024
@Pennycook Pennycook mentioned this pull request Sep 10, 2024
@Pennycook Pennycook closed this Sep 10, 2024
@Pennycook Pennycook reopened this Sep 10, 2024
Copy link
Contributor

@laserkelvin laserkelvin left a comment

Choose a reason for hiding this comment

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

LGTM

@Pennycook Pennycook merged commit 80cc42f into intel:main Sep 18, 2024
5 of 6 checks passed
@Pennycook Pennycook deleted the logging branch September 18, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants