From deb90fbca9b641aa4318c93d49595b76134f2eb2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 12 Oct 2018 14:28:21 -0400 Subject: [PATCH] Fix trace on early console connect If the trace happens before tracelog is ready, just print the output to the stdout log for now. --- confluent_server/confluent/consoleserver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index 8ab71308..76fc3d6f 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -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'