From 1921bc619a9c4af682a7707d6fe58069478c59cd Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 19 Dec 2022 10:25:12 +0100 Subject: [PATCH] logging on send --- __init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 5b12c55..b853f6e 100644 --- a/__init__.py +++ b/__init__.py @@ -65,6 +65,8 @@ class mqtt_client(object): self.__client__.subscribe(topic) def send(self, topic, payload): + logger.debug("Sending message with topic %s and payload %s", + topic, str(payload)) self.__client__.publish(topic, payload) def __on_connect__(self, client, userdata, flags, rc): @@ -75,7 +77,7 @@ class mqtt_client(object): for topic in self.__callbacks__: self.__client__.subscribe(topic) self.__block_add_callbacks__ = False - + def __on_disconnect__(self, client, flags, rc): logger.warning("Disconnect with rc=%d", rc)