New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NOTICE level to the logging module #75944
Comments
This was inspired by 31732. However syslog(3) has for decades defined NOTICE and I can't think of a good reason why this level was carried through. It serves a very useful distinction from routine and not really attention-worthy messages (INFO) but don't rise to actual WARNINGs. Things like failed authentication attempts are not warnings but also not messages to casually ignore. Hence NOTICE. Individual timed out connection attempts but before all attempts exhausted, and many other examples exist. |
I fixed the title for you, otherwise this looks like a duplicate of bpo-31732. |
As mentioned in the other tracker item, I'm against adding another level. While it might serve an exotic need, I think most users would be worse off having to learn and think about yet another level of distinction. The mental costs would be on going. FWIW, users already have the ability to define new levels (as simply as: SEMI_INTERESTING=25) but we rarely see this in practice. The long and successful history of this module is somewhat strong evidence that the current five levels suffice for most users, most of the time. |
syslog(3) is cited in the code as inspiration and has been the goto definition for logging levels for 40 years across many, many projects. NOTICE is incredibly useful especially to those of us who are sysadmins. Why would Python not implement the full suite of syslog levels? Admittedly the case for ALERT and EMERGENCY might be a stretch. It at least doesn't hobble those who want to use them. Without proper coverage one has to settle for unnecessary jumbling of Noteworthy items being buried in the torrent of Informational but not really interesting items. eg. INFO for attempting a connection. NOTICE for temporary service unavailability or handshake timeout, WARNING (maybe ERROR) for retry exhausted depending on what the failure means to the app. eg. INFO for login attempts. NOTICE for password expiry date approaching, for failed logins (bad username/passwords, locked/expired account), for password change attempts, for temporary Federated Auth connect failure. None of which rise to the level of WARNING. |
Marking as rejected/closed for the reasons cited in bpo-31732. In particular, see Vinay Sajip's commentary in https://bugs.python.org/msg304318 where he notes that it was a specific design decision to not emulate syslog(3) in this regard. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: