Commit 40bd5a05 by Vincent Pelletier

http: Use print for stderr too.

Avoids hardcoding newline char.
1 parent 78162dee
......@@ -181,13 +181,14 @@ class CaucaseSSLWSGIRequestHandler(CaucaseWSGIRequestHandler):
def log_message(self, format, *args):
# Note: compared to BaseHTTPHandler, logs the client certificate serial as
# user name.
sys.stderr.write(
"%s - %s [%s] %s\n" % (
print(
"%s - %s [%s] %s" % (
self.client_address[0],
self.ssl_client_cert_serial,
self.log_date_time_string(),
format % args,
)
),
file=sys.stderr,
)
# pylint: enable=redefined-builtin
......@@ -662,12 +663,13 @@ def main(argv=None, until=utils.until):
if host in known_host_set:
continue
known_host_set.add(host)
sys.stderr.write(
'Listening on [%s]:%i-%i\n' % (
print(
'Listening on [%s]:%i-%i' % (
host,
http_port,
https_port,
),
file=sys.stderr,
)
http_list.append(
make_server(
......@@ -780,7 +782,7 @@ def main(argv=None, until=utils.until):
except utils.SleepInterrupt:
pass
finally:
sys.stderr.write('Exiting\n')
print('Exiting', file=sys.stderr)
for server in itertools.chain(http_list, https_list):
server.server_close()
server.shutdown()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!