Write logfile as binary encoded utf-8

Change-Id: I08e3e2fbfb629a6b68b80ddaadbef71038b3eda0
This commit is contained in:
Monty Taylor 2017-06-30 15:12:42 -05:00
parent a1920ec70b
commit 1a3bb28e47
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ class Console(object):
self.logfile_name = LOG_STREAM_FILE.format(log_uuid=log_uuid)
def __enter__(self):
self.logfile = open(self.logfile_name, 'a', 0)
self.logfile = open(self.logfile_name, 'ab', buffering=0)
return self
def __exit__(self, etype, value, tb):
@ -161,7 +161,7 @@ class Console(object):
# consistent.
ts = datetime.datetime.now()
outln = '%s | %s' % (ts, ln)
self.logfile.write(outln)
self.logfile.write(outln.encode('utf-8'))
def follow(fd, log_uuid):