diff hgext/blackbox.py @ 28025:ab6468270b83

blackbox: flush output file descriptor Without this, when there are multiple ui views, each blackbox will have its own file handle, and the logging will be in a really bad order. Also, because of the way blackbox works, it never closes its file handles, which means the last output before exit is often lost.
author timeless <timeless@mozdev.org>
date Wed, 03 Feb 2016 15:18:29 +0000
parents e8f9dffca36f
children a6db1163befa
line wrap: on
line diff
--- a/hgext/blackbox.py	Wed Feb 03 18:15:18 2016 +0000
+++ b/hgext/blackbox.py	Wed Feb 03 15:18:29 2016 +0000
@@ -112,6 +112,7 @@
                 try:
                     blackbox.write('%s %s (%s)> %s' %
                                    (date, user, pid, formattedmsg))
+                    blackbox.flush()
                 except IOError as err:
                     self.debug('warning: cannot write to blackbox.log: %s\n' %
                                err.strerror)