From 8c6593cc08251c607ce5040f8f30ab93586dadc1 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 24 Nov 2009 02:48:13 -0800 Subject: [PATCH] by default flush log writes to files --HG-- branch : trunk --- py/impl/log/log.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/impl/log/log.py b/py/impl/log/log.py index 4b55c20f4..a32e850c5 100644 --- a/py/impl/log/log.py +++ b/py/impl/log/log.py @@ -132,6 +132,8 @@ class File(object): def __call__(self, msg): """ write a message to the log """ self._file.write(str(msg) + "\n") + if hasattr(self._file, 'flush'): + self._file.flush() class Path(object): """ log consumer that opens and writes to a Path """