Hi,

2014-06-13 0:38 GMT+02:00 Don Spaulding <donspauldin...@gmail.com>:
> Is this a bug or an intentional break?  If it's the latter, shouldn't this
> at least be mentioned in the "What's new in Python 3.4" document?

IMO the change is intentional. The previous behaviour was not really expected.

Python 3.3 documentation is explicit: the result is a string and the
input paramter is an integer. logging.getLevelName("DEBUG") was more
an implementation

https://docs.python.org/3.3/library/logging.html#logging.getLevelName
"Returns the textual representation of logging level lvl. If the level
is one of the predefined levels CRITICAL, ERROR, WARNING, INFO or
DEBUG then you get the corresponding string. If you have associated
levels with names using addLevelName() then the name you have
associated with lvl is returned. If a numeric value corresponding to
one of the defined levels is passed in, the corresponding string
representation is returned. Otherwise, the string ‘Level %s’ % lvl is
returned."

If your code uses something like
logger.setLevel(logging.getLevelName("DEBUG")), use directly
logger.setLevel("DEBUG").

This issue was fixed in OpenStack with this change:
https://review.openstack.org/#/c/94028/6/openstack/common/log.py,cm
https://review.openstack.org/#/c/94028/6

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to