Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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 <[email protected]>
@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