From 0b1f10a139f592ae6b36d36e68a8f4ff03703cd7 Mon Sep 17 00:00:00 2001 From: Jacob Boddey Date: Tue, 29 Oct 2024 15:58:36 +0000 Subject: [PATCH] Disable MQTT log --- framework/python/src/common/mqtt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/python/src/common/mqtt.py b/framework/python/src/common/mqtt.py index fc0458e7d..8ca52a785 100644 --- a/framework/python/src/common/mqtt.py +++ b/framework/python/src/common/mqtt.py @@ -32,13 +32,12 @@ class MQTT: def __init__(self) -> None: self._host = WEBSOCKETS_HOST self._client = mqtt_client.Client(mqtt_client.CallbackAPIVersion.VERSION2) - self._client.enable_logger(LOGGER) - LOGGER.setLevel(logger.logging.INFO) def _connect(self): """Establish connection to MQTT broker""" if not self._client.is_connected(): try: + LOGGER.debug(f"Connecting to broker {self._host}:{WEBSOCKETS_PORT}") self._client.connect(self._host, WEBSOCKETS_PORT, 60) except (ValueError, ConnectionRefusedError): LOGGER.error("Cannot connect to MQTT broker") @@ -46,6 +45,7 @@ def _connect(self): def disconnect(self): """Disconnect the local client from the MQTT broker""" if self._client.is_connected(): + LOGGER.debug("Disconnecting from broker") self._client.disconnect() def send_message(self, topic: str, message: t.Union[str, dict]) -> None: