Title: syslog missing constants
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ezyang, federico.reghenzani, python-dev, r.david.murray
Priority: normal Keywords: easy, patch

Created on 2012-03-26 18:07 by ezyang, last changed 2012-03-29 11:18 by r.david.murray. This issue is now closed.

File name Uploaded Description Edit
mywork.patch federico.reghenzani, 2012-03-27 05:56 Simple patch review
syslog_doc.patch federico.reghenzani, 2012-03-27 13:20 Added constants to doc review
Messages (14)
msg156842 - (view) Author: Edward Yang (ezyang) * Date: 2012-03-26 18:07
The syslog module is missing constants for a number of logging priorities available on modern Linuxen. In particular, the following options are missing: LOG_ODELAY, LOG_AUTHPRIV, LOG_SYSLOG, LOG_UUCP.
msg156879 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-26 23:15
LOG_SYSLOG and LOG_UUCP have been present in Python for a *long* time (since 1998 at least).

The other two are not.  What fallbacks should be used if they don't exist?

(I believe you meant 'facilities', rather than 'priorities'.)
msg156892 - (view) Author: Edward Yang (ezyang) * Date: 2012-03-27 03:22
I misspoke about UUCP. SYSLOG appears to be missing from the documentation.

Arguably they should be present if Linux supports them, and missing if they don't (same as LOG_PERROR, and some of the other constants.) Then you can do feature detection Python-side.
msg156916 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-27 12:33
That's probably reasonable (we have precedents for that in other modules), except that that's not how the older possibly-not-there constants work.  For backward compatibility reasons we can't change the older constants, but I don't see any reason we can't do it for the "new" ones.

We can fix the omission of SYSLOG in the 2.7 and 3.2 docs.  That should be a separate patch.
msg156918 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-27 12:34
Frederico: thanks for the patch.  Do you want to do the doc patches as well?
msg156920 - (view) Author: Federico Reghenzani (federico.reghenzani) * Date: 2012-03-27 13:20
Done. I'm a newbie, I hope I did it right :)
msg156921 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-27 13:37
Close.  We either need to mention that LOG_AUTHPRIV is only defined if the platform defines it, or we need to change the implementation so that it is always defined (by mapping it to some other facility if it doesn't exist).  I'm of mixed mind about it: the former makes some sense to me, but the module precedent is clearly intentionally the latter.

In the absence of a good reason to do otherwise, I think we should follow the module precedent.

Anyone else have an opinion?
msg156938 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-27 16:05
Thinking about this some more, I think that AUTHPRIV is special.  You don't want to inadvertently log AUTHPRIV stuff to some other facility.  So I think the code patch is good, and we should add a note to the docs that AUTHPRIV may not exist on all platforms.
msg156939 - (view) Author: Federico Reghenzani (federico.reghenzani) * Date: 2012-03-27 16:26
We can define AUTHPRIV as AUTH if it doesn't exist in that platform and insert a note in the docs.
msg156941 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-27 16:44
From what I understand, that defeats the purpose of AUTHPRIV, which is to log messages that should be logged in a "safer" location than AUTH.  That's why I said it was a special case.  In other words, if an application is going to be logging, say, a password, it is better that it fail than that it log the password insecurely.
msg157027 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-29 10:48
New changeset 04c19ac9734a by R David Murray in branch '3.2':
#14416: add missing LOG_SYSLOG facility to syslog docs.

New changeset c40e5120a9b1 by R David Murray in branch '2.7':
#14416: add missing LOG_SYSLOG facility to syslog docs.
msg157028 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-29 10:49
New changeset 91bafdf7d7a4 by R David Murray in branch 'default':
Merge #14416: add missing LOG_SYSLOG facility to syslog docs.
msg157032 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-29 11:16
New changeset dc8e61044055 by R David Murray in branch 'default':
#14416: conditionally add LOG_AUTHPRIV facility and LOG_ODELAY to syslog.
msg157033 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-29 11:18
Thanks, Federico, and welcome to the ACKS file.

It looks like you are planning to contribute more, so if you haven't already done so could you please submit a contributor agreement?
Date User Action Args
2012-03-29 11:18:55r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg157033

stage: needs patch -> resolved
2012-03-29 11:16:19python-devsetmessages: + msg157032
2012-03-29 10:49:44python-devsetmessages: + msg157028
2012-03-29 10:48:23python-devsetnosy: + python-dev
messages: + msg157027
2012-03-27 16:44:52r.david.murraysetmessages: + msg156941
2012-03-27 16:26:11federico.reghenzanisetmessages: + msg156939
2012-03-27 16:05:41r.david.murraysetmessages: + msg156938
2012-03-27 13:37:50r.david.murraysetmessages: + msg156921
2012-03-27 13:20:30federico.reghenzanisetfiles: + syslog_doc.patch

messages: + msg156920
2012-03-27 12:34:21r.david.murraysetmessages: + msg156918
2012-03-27 12:33:12r.david.murraysetmessages: + msg156916
2012-03-27 12:31:36federico.reghenzanisetnosy: + federico.reghenzani
2012-03-27 05:56:34federico.reghenzanisetfiles: + mywork.patch
keywords: + patch
2012-03-27 03:22:33ezyangsetmessages: + msg156892
2012-03-26 23:15:23r.david.murraysetversions: + Python 3.3, - Python 2.7
nosy: + r.david.murray

messages: + msg156879

keywords: + easy
stage: needs patch
2012-03-26 18:07:24ezyangcreate