[New-bugs-announce] [issue22386] Python 3.4 logging.getLevelName() no longer maps string to level.
report at bugs.python.org
Thu Sep 11 03:09:58 CEST 2014
New submission from Clark Boylan:
Prior to http://hg.python.org/cpython/rev/5629bf4c6bba?revcount=60 logging.getLevelName(lvl) would map string lvl args like 'INFO' to the integer level value 20. After this change the string to int level mapping is removed and you can only map level to string. This removes the only public method for doing this mapping in the logging module.
The old behavior is valuable because it allows you to sanity check log levels provided as strings before attempting to use them. It seems that without this public mapping you have to rely on Logger.setLevel(lvl) throwing a ValueError which it seems to do only in 2.7 and greater.
components: Library (Lib)
title: Python 3.4 logging.getLevelName() no longer maps string to level.
versions: Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce