Browse Source

logging on send

master
Dirk Alders 1 year ago
parent
commit
1921bc619a
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      __init__.py

+ 3
- 1
__init__.py View File

65
         self.__client__.subscribe(topic)
65
         self.__client__.subscribe(topic)
66
 
66
 
67
     def send(self, topic, payload):
67
     def send(self, topic, payload):
68
+        logger.debug("Sending message with topic %s and payload %s",
69
+                     topic, str(payload))
68
         self.__client__.publish(topic, payload)
70
         self.__client__.publish(topic, payload)
69
 
71
 
70
     def __on_connect__(self, client, userdata, flags, rc):
72
     def __on_connect__(self, client, userdata, flags, rc):
75
             for topic in self.__callbacks__:
77
             for topic in self.__callbacks__:
76
                 self.__client__.subscribe(topic)
78
                 self.__client__.subscribe(topic)
77
             self.__block_add_callbacks__ = False
79
             self.__block_add_callbacks__ = False
78
- 
80
+
79
     def __on_disconnect__(self, client, flags, rc):
81
     def __on_disconnect__(self, client, flags, rc):
80
         logger.warning("Disconnect with rc=%d", rc)
82
         logger.warning("Disconnect with rc=%d", rc)
81
 
83
 

Loading…
Cancel
Save