add catched error to log

This commit is contained in:
Florian Bezannier
2020-11-26 17:45:30 +01:00
parent be511f5640
commit 129988405c
+2 -2
View File
@@ -202,7 +202,7 @@ class MyPSACC:
client.subscribe(topic)
logger.info("subscribe to " + topic)
except:
traceback.print_exc()
logger.error(traceback.format_exc())
def on_mqtt_disconnect(self, client, userdata, rc):
try:
@@ -211,7 +211,7 @@ class MyPSACC:
# reconnect then subscriptions will be renewed.
logger.warn(mqtt.error_string(rc))
except:
traceback.print_exc()
logger.error(traceback.format_exc())
def on_mqtt_message(self, client, userdata, msg):
logger.info(f"mqtt msg {msg.topic} {str(msg.payload)}")