Commit 539c830c authored by Tang's avatar Tang

Fix issue in logger name and in mqtt client configuration (same client_id...

Fix issue in logger name and in mqtt client configuration (same client_id makes client connect and disconnect all the time)
parent 850fc467
Pipeline #474 passed with stage
in 2 minutes and 44 seconds
......@@ -238,7 +238,7 @@ class AgoApp:
self.log_handler.setFormatter(self.log_formatter)
root.addHandler(self.log_handler)
self.log = logging.getLogger("app")
self.log = logging.getLogger(self.app_name)
def setup_connection(self):
"""Create an AgoConnection instance, assigned to self.connection"""
......
......@@ -38,7 +38,7 @@ class AgoMqttTransport(agoclient.agotransport.AgoTransport):
self.pending_replies = {}
def start(self):
self.mqtt = mqtt.Client(self.broker, clean_session=True)
self.mqtt = mqtt.Client(client_id=self.connection_uuid, clean_session=True)
if self.username and self.password:
self.mqtt.username_pw_set(self.username, self.password)
......@@ -217,4 +217,5 @@ class AgoMqttTransport(agoclient.agotransport.AgoTransport):
def _sendreply(self, reply_to, content):
"""Internal used to send a reply."""
self.log.trace("Sending reply to %s: %s", reply_to, content)
self._send_message(reply_to, content)
\ No newline at end of file
self._send_message(reply_to, content)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment