-
Notifications
You must be signed in to change notification settings - Fork 555
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
A few log level handling cleanups #6393
Merged
rapids-bot
merged 4 commits into
rapidsai:branch-25.04
from
jcrist:cleanup-log-level-handling
Mar 5, 2025
Merged
A few log level handling cleanups #6393
rapids-bot
merged 4 commits into
rapidsai:branch-25.04
from
jcrist:cleanup-log-level-handling
Mar 5, 2025
Conversation
This file contains 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
Previously we had conversion to/from the `logger.level_enum` and `verbose` parameters strewn across the codebase. We now centralize this in 2 common utility functions. In the future we should also aim to reduce the number of places where we need to handle this at all, but for now this is a slight improvement.
Previously we weren't translating `verbose` to `level_enum` in the `simpl_set` functions. This meant that the default value (`False`) would be cast to `level_enum`, resulting in the logger being set to `0` (trace). This doesn't fix the larger issue that our `verbose` handling mutates the global logger settings. It does ensure we're at least translating things correctly though.
jcrist
commented
Mar 4, 2025
return level_enum(6 - verbose) | ||
|
||
|
||
def _verbose_from_level(level: level_enum) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally these would be methods on the level_enum
enum (e.g. level_enum.from_verbose(verbose)
...), but cython doesn't seem to like any of the ways I wanted to spell this. Leaving these as internal utils for now.
csadorf
approved these changes
Mar 5, 2025
/merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This PR does two things:
verbose
<-> log level handlingPreviously we had conversion to/from the
logger.level_enum
andverbose
parameters strewn across the codebase. We now centralize this in 2 common utility functions. In the future we should also aim to reduce the number of places where we need to handle this at all, but for now this is a slight improvement.verbose
tolevel_enum
insimpl_set.pyx
Previously we weren't translating
verbose
tolevel_enum
in thesimpl_set
functions. This meant that the default value (False
) would be cast tolevel_enum
, resulting in the logger being set to0
(trace).This doesn't fix the larger issue that our
verbose
handling mutates the global logger settings. It does ensure we're at least mutating it to the correct enum value though.