Log full stack trace on socket connection errors when debug logging

Might help bring some clarity for #1523
This commit is contained in:
Gina Häußge 2016-10-04 10:18:14 +02:00
parent e038cfa4dc
commit bc0880711b

View file

@ -203,4 +203,7 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection, octoprint.printer.
try:
self.send({type: payload})
except Exception as e:
self._logger.warn("Could not send message to client %s: %s" % (self._remoteAddress, str(e)))
if self._logger.isEnabledFor(logging.DEBUG):
self._logger.exception("Could not send message to client {}".format(self._remoteAddress))
else:
self._logger.warn("Could not send message to client {}: {}".format(self._remoteAddress, e))