[New-bugs-announce] [issue43858] Provide method to get list of logging level names

Andy Lowry report at bugs.python.org
Thu Apr 15 13:46:57 EDT 2021


New submission from Andy Lowry <andrew at nglowry.com>:

It would be useful to have something like a `getLevelNames` method to return the current list of level names, ordered by priority.

This currently appears to be available only by accessing a private member, like `_levelToName` or `_nameToLevel`.

This functionality is useful, for example, in populating a `choices` list for an `argparse` option to allow a user to select a logging level when launching a program from a command line.

----------
components: Library (Lib)
messages: 391145
nosy: andylowry
priority: normal
severity: normal
status: open
title: Provide method to get list of logging level names
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43858>
_______________________________________


More information about the New-bugs-announce mailing list