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

Avoid get_logger overriding root logger level #17569

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

BowenBao
Copy link
Contributor

Description

Instead, set level to DEBUG for the logger returned.

Motivation and Context

Otherwise, this function call overrides root logger level setting, which affects logging facility of other python packages.

Copy link
Contributor

@thiagocrepaldi thiagocrepaldi left a comment

Choose a reason for hiding this comment

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

Out of curiosity, does that mean that, with the proposed change, the format setting will still override the other python packages loggers (but not level)?

@BowenBao
Copy link
Contributor Author

BowenBao commented Sep 18, 2023

Out of curiosity, does that mean that, with the proposed change, the format setting will still override the other python packages loggers (but not level)?

You are right, it shouldn't be hard to keep format local as well, I'll do that in this one.

Turns out to be pretty hacky involving handler and more details since formatter is not exposed on logger level for individual logger. Leaving as is for formatting in this PR. ref https://stackoverflow.com/questions/11581794/how-do-i-change-the-format-of-a-python-log-message-on-a-per-logger-basis

@BowenBao BowenBao merged commit 152e61d into main Sep 19, 2023
@BowenBao BowenBao deleted the bowbao/logger_level branch September 19, 2023 17:42
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
Instead, set level to DEBUG for the logger returned.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Otherwise, this function call overrides root logger level setting, which
affects logging facility of other python packages.
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.

2 participants