Skip to content

Fix deprecated usage of getLevelName#19959

Merged
seanbudd merged 5 commits intomasterfrom
fixGetLevelName
Apr 21, 2026
Merged

Fix deprecated usage of getLevelName#19959
seanbudd merged 5 commits intomasterfrom
fixGetLevelName

Conversation

@seanbudd
Copy link
Copy Markdown
Member

Converting loglevel name strings to integers via getLevelName is deprecated. Instead you are meant to use getLevelNamesMapping now.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates log level parsing to avoid deprecated logging.getLevelName usage when converting level names (strings) into level numbers (ints).

Changes:

  • Replace logging.getLevelName(levelName) (string → int) with logging.getLevelNamesMapping() lookup in setLogLevelFromConfig.
  • Add a type annotation for levelName.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/logHandler.py Outdated
Comment thread source/logHandler.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Apr 20, 2026
Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

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

Looks fine, though I do think tiwould be cleaner to fix up other instances here as well.

@seanbudd seanbudd requested a review from SaschaCowley April 21, 2026 01:30
@seanbudd
Copy link
Copy Markdown
Member Author

Fixed up other instance - since I might close #19957

Comment thread source/config/__init__.py Outdated
@seanbudd seanbudd merged commit f063a56 into master Apr 21, 2026
38 of 41 checks passed
@seanbudd seanbudd deleted the fixGetLevelName branch April 21, 2026 02:15
@github-actions github-actions Bot added this to the 2026.2 milestone Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants