This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: logging level FATAL missing in _nameToLevel
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Ondřej Medek, python-dev, vinay.sajip, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-09-02 06:32 by Ondřej Medek, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue27935.patch xiang.zhang, 2016-09-02 08:30 review
Messages (5)
msg274204 - (view) Author: Ondřej Medek (Ondřej Medek) Date: 2016-09-02 06:32
logging.__init__._nameToLevel is missing 'FATAL' key:

>>> logging.getLevelName('FATAL')
'Level FATAL'

Expected same as:
>>> logging.getLevelName('CRITICAL')
50
msg274209 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-02 08:30
Though FATAL is not mentioned in the doc, but I think it should be added to getLevelName, just like how WARN is handled now:

>>> logging.getLevelName("WARN")
30
msg274303 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2016-09-03 15:59
As this is an (admittedly small) change in behaviour, I'll apply in 3.6.
msg274305 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-03 16:04
New changeset 85f9f8bf2ec8 by Vinay Sajip in branch 'default':
Closes #27935: returned numeric value for 'FATAL' logging level.
https://hg.python.org/cpython/rev/85f9f8bf2ec8
msg274318 - (view) Author: Ondřej Medek (Ondřej Medek) Date: 2016-09-03 18:12
Just a comment to the https://hg.python.org/cpython/rev/85f9f8bf2ec8

It's functionality is right. It's just a little bit weird, that two derived levels in _nameToLevel: 'FATAL' maps to FATAL, i.e. itself, while 'WARN' maps to the WARNING, i.e. to the main level from which is derived.
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 72122
2016-09-03 18:12:28Ondřej Medeksetmessages: + msg274318
2016-09-03 16:04:45python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg274305

resolution: fixed
stage: resolved
2016-09-03 15:59:16vinay.sajipsetmessages: + msg274303
versions: + Python 3.6, - Python 3.5
2016-09-02 08:30:59xiang.zhangsetfiles: + issue27935.patch

nosy: + xiang.zhang
messages: + msg274209

keywords: + patch
2016-09-02 07:37:51SilentGhostsetnosy: + vinay.sajip
2016-09-02 06:32:22Ondřej Medekcreate