[New-bugs-announce] [issue32559] logging - public function to get level from name

Varun Agrawal report at bugs.python.org
Mon Jan 15 13:01:51 EST 2018


New submission from Varun Agrawal <varagrawal at gmail.com>:

Currently, the logging module has a function `getLevelName` and directly accessing the `_nameToLevel` dict is poor practice bordering on non-pythonic.

It would be nice to have a simple method like `getNameLevel` in the module to retrieve the logger level given the name. This can then be used in things such as argument parsers so someone can pass in the logging level name and the logging level can be appropriately set.

----------
components: Library (Lib)
messages: 310005
nosy: varunagrawal
priority: normal
severity: normal
status: open
title: logging - public function to get level from name
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list