hgweb: make log streams compatible with command server
authorYuya Nishihara <yuya@tcha.org>
Sat, 28 Jun 2014 13:13:32 +0900
changeset 30278 dd3dd80fca10
parent 30277 7f2313450e86
child 30279 6a8aff737a17
hgweb: make log streams compatible with command server Even though it would be useless to start a web server by a command server, it should be doable in principle. Also, we can't use sys.stdout/err directly on Python 3 because they are unicode streams.
mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	Mon Feb 29 13:41:54 2016 +0900
+++ b/mercurial/hgweb/server.py	Sat Jun 28 13:13:32 2014 +0900
@@ -281,8 +281,8 @@
             prefix = '/' + prefix.strip('/')
         self.prefix = prefix
 
-        alog = openlog(ui.config('web', 'accesslog', '-'), sys.stdout)
-        elog = openlog(ui.config('web', 'errorlog', '-'), sys.stderr)
+        alog = openlog(ui.config('web', 'accesslog', '-'), ui.fout)
+        elog = openlog(ui.config('web', 'errorlog', '-'), ui.ferr)
         self.accesslog = alog
         self.errorlog = elog