Skip to content

MNT: Prefer capitalized logging levels #30339

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

Merged
merged 2 commits into from
Jul 22, 2025

Conversation

timhoffm
Copy link
Member

#30302 just introduced literals for the log levels. Previously, the situation was a bit vague: While the docstring described the levels as all lowercase, in fact any casing is accepted. This PR changes the preferred casing to be all-capitalized in analogy to the logging standard library, which only supports this casing. Lowercase remains supported because it's not worth an API breakage.

We might later consider to also accept logging levels directly, i.e. logging.DEBUG to be more congruent with the logging library. But this can be done any time. It's important to get this PR in soon to not release the typing Literal in lowercase form.

matplotlib#30302 just introduced literals for the log levels. Previously, the
situation was a bit vague: While the docstring described the levels
as all lowercase, in fact any casing is accepted. This PR changes the
preferred casing to be all-capitalized in analogy to the logging
standard library, which only supports this casing. Lowercase remains
supported because it's not worth an API breakage.

We might later consider to also accept logging levels directly, i.e.
`logging.DEBUG` to be more congruent with the logging library. But this
can be done any time. It's important to get this PR in soon to not
release the typing Literal in lowercase form.
@github-actions github-actions bot added Documentation: devdocs files in doc/devel Documentation: user guide files in galleries/users_explain or doc/users labels Jul 21, 2025
@QuLogic QuLogic added this to the v3.11.0 milestone Jul 21, 2025
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@timhoffm timhoffm merged commit fec45c6 into matplotlib:main Jul 22, 2025
40 checks passed
@timhoffm timhoffm deleted the loglevel-casing branch July 22, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: devdocs files in doc/devel Documentation: user guide files in galleries/users_explain or doc/users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy