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) *  |
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) *  |
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) *  |
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) *  |
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) *  |
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) *  |
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)  |
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. http://hg.python.org/cpython/rev/04c19ac9734a New changeset c40e5120a9b1 by R David Murray in branch '2.7': #14416: add missing LOG_SYSLOG facility to syslog docs. http://hg.python.org/cpython/rev/c40e5120a9b1 |
|
|
msg157028 - (view) |
Author: Roundup Robot (python-dev)  |
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. http://hg.python.org/cpython/rev/91bafdf7d7a4 |
|
|
msg157032 - (view) |
Author: Roundup Robot (python-dev)  |
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. http://hg.python.org/cpython/rev/dc8e61044055 |
|
|
msg157033 - (view) |
Author: R. David Murray (r.david.murray) *  |
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? http://www.python.org/psf/contrib/contrib-form/ |
|
|