changeset 5557:c47484fab02e

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Wed, 28 Nov 2007 00:11:55 +0100
parents 61fdf2558c0a (current diff) f2f42262adbd (diff)
children 72cb6bde5355
files
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Tue Nov 27 09:44:09 2007 -0800
+++ b/mercurial/hgweb/server.py	Wed Nov 28 00:11:55 2007 +0100
@@ -44,17 +44,17 @@
         self.protocol_version = 'HTTP/1.1'
         BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kargs)
 
+    def _log_any(self, fp, format, *args):
+        fp.write("%s - - [%s] %s\n" % (self.client_address[0],
+                                       self.log_date_time_string(),
+                                       format % args))
+        fp.flush()
+
     def log_error(self, format, *args):
-        errorlog = self.server.errorlog
-        errorlog.write("%s - - [%s] %s\n" % (self.client_address[0],
-                                             self.log_date_time_string(),
-                                             format % args))
+        self._log_any(self.server.errorlog, format, *args)
 
     def log_message(self, format, *args):
-        accesslog = self.server.accesslog
-        accesslog.write("%s - - [%s] %s\n" % (self.client_address[0],
-                                              self.log_date_time_string(),
-                                              format % args))
+        self._log_any(self.server.accesslog, format, *args)
 
     def do_write(self):
         try: