You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add argument to control file object used by BaseHTTPServer’s log_message #50851
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=Noneclosed_at=<Date2013-10-13.18:33:55.093>created_at=<Date2009-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=<Date2013-10-13.18:33:55.091>user='https://bugs.python.org/tomkm'
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.
BreamoreBoy commented on Aug 1, 2010
BreamoreBoymannequin
Mannequin
More actions
The OP's comments strike me as sensible, do others agree or disagree?
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.
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.
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.
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
Activity
tomkm commentedon Jul 30, 2009
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.
BreamoreBoy commentedon Aug 1, 2010
The OP's comments strike me as sensible, do others agree or disagree?
dstanek commentedon Aug 4, 2010
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.
pitrou commentedon May 7, 2012
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.
merwok commentedon May 8, 2012
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.
[-]BaseHTTPServer log_message should log to sys.stdout[/-][+]Add argument to control file object used by BaseHTTPServer’s log_message[/+]birkenfeld commentedon Oct 13, 2013
Agreed.