Skip to content
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

syslog missing constants #58624

Closed
ezyang mannequin opened this issue Mar 26, 2012 · 14 comments
Closed

syslog missing constants #58624

ezyang mannequin opened this issue Mar 26, 2012 · 14 comments
Labels
easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ezyang
Copy link
Mannequin

ezyang mannequin commented Mar 26, 2012

BPO 14416
Nosy @bitdancer, @ezyang
Files
  • mywork.patch: Simple patch
  • syslog_doc.patch: Added constants to doc
  • 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:

    assignee = None
    closed_at = <Date 2012-03-29.11:18:55.153>
    created_at = <Date 2012-03-26.18:07:24.915>
    labels = ['easy', 'type-feature', 'library']
    title = 'syslog missing constants'
    updated_at = <Date 2012-03-29.11:18:55.152>
    user = 'https://github.com/ezyang'

    bugs.python.org fields:

    activity = <Date 2012-03-29.11:18:55.152>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-03-29.11:18:55.153>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2012-03-26.18:07:24.915>
    creator = 'ezyang'
    dependencies = []
    files = ['25036', '25041']
    hgrepos = []
    issue_num = 14416
    keywords = ['patch', 'easy']
    message_count = 14.0
    messages = ['156842', '156879', '156892', '156916', '156918', '156920', '156921', '156938', '156939', '156941', '157027', '157028', '157032', '157033']
    nosy_count = 4.0
    nosy_names = ['r.david.murray', 'python-dev', 'ezyang', 'federico.reghenzani']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue14416'
    versions = ['Python 3.3']

    @ezyang
    Copy link
    Mannequin Author

    ezyang mannequin commented Mar 26, 2012

    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.

    @ezyang ezyang mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 26, 2012
    @bitdancer
    Copy link
    Member

    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'.)

    @bitdancer bitdancer added the easy label Mar 26, 2012
    @ezyang
    Copy link
    Mannequin Author

    ezyang mannequin commented Mar 27, 2012

    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.

    @bitdancer
    Copy link
    Member

    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.

    @bitdancer
    Copy link
    Member

    Frederico: thanks for the patch. Do you want to do the doc patches as well?

    @federicoreghenzani
    Copy link
    Mannequin

    federicoreghenzani mannequin commented Mar 27, 2012

    Done. I'm a newbie, I hope I did it right :)

    @bitdancer
    Copy link
    Member

    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?

    @bitdancer
    Copy link
    Member

    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.

    @federicoreghenzani
    Copy link
    Mannequin

    federicoreghenzani mannequin commented Mar 27, 2012

    We can define AUTHPRIV as AUTH if it doesn't exist in that platform and insert a note in the docs.

    @bitdancer
    Copy link
    Member

    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.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 29, 2012

    New changeset 04c19ac9734a by R David Murray in branch '3.2':
    bpo-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':
    bpo-14416: add missing LOG_SYSLOG facility to syslog docs.
    http://hg.python.org/cpython/rev/c40e5120a9b1

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 29, 2012

    New changeset 91bafdf7d7a4 by R David Murray in branch 'default':
    Merge bpo-14416: add missing LOG_SYSLOG facility to syslog docs.
    http://hg.python.org/cpython/rev/91bafdf7d7a4

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 29, 2012

    New changeset dc8e61044055 by R David Murray in branch 'default':
    bpo-14416: conditionally add LOG_AUTHPRIV facility and LOG_ODELAY to syslog.
    http://hg.python.org/cpython/rev/dc8e61044055

    @bitdancer
    Copy link
    Member

    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/

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant