2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-16 04:39:16 +00:00

Fix trace on early console connect

If the trace happens before tracelog is ready, just print the output
to the stdout log for now.
This commit is contained in:
Jarrod Johnson 2018-10-12 14:28:21 -04:00
parent 3105b9b1f9
commit deb90fbca9

View File

@ -359,8 +359,11 @@ class ConsoleHandler(object):
except (exc.NotImplementedException, exc.NotFoundException):
self._console = None
except:
_tracelog.log(traceback.format_exc(), ltype=log.DataTypes.event,
event=log.Events.stacktrace)
if _tracelog:
_tracelog.log(traceback.format_exc(), ltype=log.DataTypes.event,
event=log.Events.stacktrace)
else:
print(traceback.format_exc())
if not isinstance(self._console, conapi.Console):
self.clearbuffer()
self.connectstate = 'unconnected'