diff options
author | Tomas Vondra | 2016-10-13 11:47:33 +0000 |
---|---|---|
committer | Tomas Vondra | 2017-02-27 00:32:51 +0000 |
commit | 61ec817410f3246063da9ecc9afe79b0a1ed974f (patch) | |
tree | c4c765c874399b06322d9f187f9cec7b3a6172c4 | |
parent | d8fe8b8ca939089d3fbe31b8904aa532bac294a5 (diff) |
explicitly flush stdout in log()
Otherwise the messages may get buffered for a quite long time, which
is annoying, particularly in multi-process system.
-rw-r--r-- | client/utils/logging.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/client/utils/logging.py b/client/utils/logging.py index 9e12c88..964480f 100644 --- a/client/utils/logging.py +++ b/client/utils/logging.py @@ -1,3 +1,4 @@ +import sys import time def log(message): @@ -7,3 +8,5 @@ def log(message): 'epoch' : time.time(), 'date' : time.strftime('%Y-%m-%d %H:%M:%S'), 'message' : message} + + sys.stdout.flush() |