added debug prefix

This commit is contained in:
Kostas Drakontidis
2026-05-25 05:54:37 +03:00
parent c8da529ce3
commit 66ab3fa6ca
+3 -3
View File
@@ -13,13 +13,13 @@ function initMqtt(): Promise<MqttClient> {
); );
client.once("connect", () => { client.once("connect", () => {
console.log("MQTT connected."); console.log("[MQTT] MQTT connected.");
client.subscribe(config.mqtt.topic, (err) => { client.subscribe(config.mqtt.topic, (err) => {
if (err) { if (err) {
reject(err); reject(err);
} else { } else {
console.log("MQTT subscribed."); console.log("[MQTT] MQTT subscribed.");
resolve(client); resolve(client);
} }
}); });
@@ -43,6 +43,6 @@ export async function start() {
console.log(err.message); console.log(err.message);
}) })
} catch (err: any) { } catch (err: any) {
console.log("MQTT connection failed:", err.message); console.log("[MQTT] MQTT connection failed:", err.message);
} }
} }