comparison mercurial/hgweb/server.py @ 30264:dd3dd80fca10

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.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 28 Jun 2014 13:13:32 +0900
parents ebc03e64548a
children d524c88511a7
comparison
equal deleted inserted replaced
30263:7f2313450e86 30264:dd3dd80fca10
279 prefix = ui.config('web', 'prefix', '') 279 prefix = ui.config('web', 'prefix', '')
280 if prefix: 280 if prefix:
281 prefix = '/' + prefix.strip('/') 281 prefix = '/' + prefix.strip('/')
282 self.prefix = prefix 282 self.prefix = prefix
283 283
284 alog = openlog(ui.config('web', 'accesslog', '-'), sys.stdout) 284 alog = openlog(ui.config('web', 'accesslog', '-'), ui.fout)
285 elog = openlog(ui.config('web', 'errorlog', '-'), sys.stderr) 285 elog = openlog(ui.config('web', 'errorlog', '-'), ui.ferr)
286 self.accesslog = alog 286 self.accesslog = alog
287 self.errorlog = elog 287 self.errorlog = elog
288 288
289 self.addr, self.port = self.socket.getsockname()[0:2] 289 self.addr, self.port = self.socket.getsockname()[0:2]
290 self.fqaddr = socket.getfqdn(addr[0]) 290 self.fqaddr = socket.getfqdn(addr[0])