mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
test-static-http: flush access log per request
It appears that stderr is fully buffered on Windows. # no-check-commit because of log_message() function
This commit is contained in:
parent
956c057ed5
commit
1fa3521832
@ -26,12 +26,16 @@ if os.environ.get('HGIPV6', '0') == '1':
|
||||
else:
|
||||
simplehttpserver = httpserver.httpserver
|
||||
|
||||
class _httprequesthandler(httpserver.simplehttprequesthandler):
|
||||
def log_message(self, format, *args):
|
||||
httpserver.simplehttprequesthandler.log_message(self, format, *args)
|
||||
sys.stderr.flush()
|
||||
|
||||
class simplehttpservice(object):
|
||||
def __init__(self, host, port):
|
||||
self.address = (host, port)
|
||||
def init(self):
|
||||
self.httpd = simplehttpserver(
|
||||
self.address, httpserver.simplehttprequesthandler)
|
||||
self.httpd = simplehttpserver(self.address, _httprequesthandler)
|
||||
def run(self):
|
||||
self.httpd.serve_forever()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user