summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-09-25 16:16:31 +0200
committerLars-Dominik Braun <lars@6xq.net>2018-09-25 16:16:31 +0200
commit329de53c7c8cea725249089df87d6cd9823f6972 (patch)
tree907ce5c7d86252b0187ac3a89034c1e9c41fefb5 /crocoite
parentfd383fd5f5bac0a4cebbacf7e1ffccfd0be04e50 (diff)
downloadcrocoite-329de53c7c8cea725249089df87d6cd9823f6972.tar.gz
crocoite-329de53c7c8cea725249089df87d6cd9823f6972.tar.bz2
crocoite-329de53c7c8cea725249089df87d6cd9823f6972.zip
Immediately flush logger
Consumers can read the latest gossip faster now.
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/logger.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/crocoite/logger.py b/crocoite/logger.py
index 4b43e02..e8ff594 100644
--- a/crocoite/logger.py
+++ b/crocoite/logger.py
@@ -97,6 +97,7 @@ class PrintConsumer (Consumer):
def __call__ (self, **kwargs):
sys.stderr.write (str (kwargs))
sys.stderr.write ('\n')
+ sys.stderr.flush ()
return kwargs
class JsonEncoder (json.JSONEncoder):
@@ -118,6 +119,7 @@ class JsonPrintConsumer (Consumer):
if kwargs['level'] >= self.minLevel:
json.dump (kwargs, sys.stdout, cls=JsonEncoder)
sys.stdout.write ('\n')
+ sys.stdout.flush ()
return kwargs
class DatetimeConsumer (Consumer):