Skip to content

Add argument to control file object used by BaseHTTPServer’s log_message #50851

Closed

Description

@tomkm
mannequin
BPO 6602
Nosy @birkenfeld, @pitrou, @merwok
Files
  • 6602.patch
  • 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 2013-10-13.18:33:55.093>
    created_at = <Date 2009-07-30.11:13:23.251>
    labels = ['easy', 'type-bug', 'library']
    title = 'Add argument to control file object used by BaseHTTPServer\xe2\x80\x99s log_message'
    updated_at = <Date 2013-10-13.18:33:55.091>
    user = 'https://bugs.python.org/tomkm'

    bugs.python.org fields:

    activity = <Date 2013-10-13.18:33:55.091>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-13.18:33:55.093>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2009-07-30.11:13:23.251>
    creator = 'tomkm'
    dependencies = []
    files = ['18365']
    hgrepos = []
    issue_num = 6602
    keywords = ['patch', 'easy']
    message_count = 6.0
    messages = ['91093', '112305', '112733', '160137', '160183', '199757']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'pitrou', 'dstanek', 'eric.araujo', 'tomkm', 'BreamoreBoy']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6602'
    versions = ['Python 3.3']

    Activity

    1. tomkm commented on Jul 30, 2009

      tomkmmannequin
      MannequinAuthor

      I believe that the log_message method of BaseHTTPServer should log to
      sys.stdout not sys.stderr, whereas log_error should log to sys.stderr
      instead of just delegating to log_message.

      I found this inconsistency when using SimpleXMLRPCServer which logs both
      successful (200) and non-successful (non-200) requests to stderr when
      logRequests is set to True.

    2. BreamoreBoy commented on Aug 1, 2010

      BreamoreBoymannequin
      Mannequin

      The OP's comments strike me as sensible, do others agree or disagree?

    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Aug 1, 2010
    4. dstanek commented on Aug 4, 2010

      dstanekmannequin
      Mannequin

      I think this is the right thing to do. To help this along I've included a patch. The codereview is also available: http://codereview.appspot.com/1697062.

    5. pitrou commented on May 7, 2012

      @pitrou
      Member

      Disagreed. sys.stderr is not only for "errors" but all informational messages of little value (warnings, debug messages etc.). Also, logging to two different streams makes redirecting clumsier.

      If you want to change this, it would more useful to add a facility to allow users to choose output streams. Or even - shocking idea - to integrate the logging module in BaseHTTPServer.

    6. merwok commented on May 8, 2012

      @merwok
      Member

      Clearly +1 to Antoine; that’s just how unix programs do it. stdout is for the program output, which may be formatted in a certain way in order to be piped to another program, and stderr is for all messages for the human user. Editing the bug title and version to reflect Antoine’s suggestion, which does have a chance of going in if someone is interested in providing a patch.

    7. changed the title [-]BaseHTTPServer log_message should log to sys.stdout[/-] [+]Add argument to control file object used by BaseHTTPServer’s log_message[/+] on May 8, 2012
    8. birkenfeld commented on Oct 13, 2013

      @birkenfeld
      Member

      Agreed.

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      easystdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions