2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Fix some more python3 issues

This commit is contained in:
Jarrod Johnson 2019-10-09 13:42:17 -04:00
parent bc85d93cf4
commit a39d45d03c

View File

@ -600,7 +600,11 @@ class Logger(object):
if ltype == 2:
textrecord = data
else:
textrecord = textdate + data + ']'
if not isinstance(textdate, bytes):
textdate = textdate.encode('utf-8')
if not isinstance(data, bytes):
data = data.encode('utf-8')
textrecord = textdate + data + b']'
else:
textrecord = textdate + data
if not textrecord.endswith('\n'):
@ -798,4 +802,4 @@ def logtrace():
if tracelog is None:
tracelog = Logger('trace', buffered=False)
tracelog.log(traceback.format_exc(), ltype=DataTypes.event,
event=Events.stacktrace)
event=Events.stacktrace)