From ed9a9391215131cb8e6473b35d568b550b181fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20CHOMAZ?= Date: Tue, 3 Feb 2026 21:12:56 +0100 Subject: [PATCH] =?UTF-8?q?(update)=20Mise=20=C3=A0=20jour=20de=20buzzer-w?= =?UTF-8?q?atcher.js=20pour=20mettre=20en=20forme=20le=20debug=20de=20cons?= =?UTF-8?q?ole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VNode/services/buzzer/buzzer-watcher.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/VNode/services/buzzer/buzzer-watcher.js b/VNode/services/buzzer/buzzer-watcher.js index fbf4ab54..f723ac27 100644 --- a/VNode/services/buzzer/buzzer-watcher.js +++ b/VNode/services/buzzer/buzzer-watcher.js @@ -13,7 +13,7 @@ const { mqttHost, hosts: { buzzers: { IP: buzzerIPs, MQTTconfig: { mqttTopic } } const client = mqtt.connect(mqttHost); client.on('connect', () => { - console.log(`Connecté au broker MQTT à ${mqttHost}`); + console.log(`[INFO] Connecté au broker MQTT à ${mqttHost}`); // Fonction pour pinger les buzzers et publier l'état const pingAndPublish = async () => { @@ -24,9 +24,8 @@ client.on('connect', () => { // Publication du statut dans le topic MQTT client.publish(`${mqttTopic}`, JSON.stringify({ buzzer: buzzerName, ip, status })); - console.log(`Ping ${buzzerName} (${ip}) - Status: ${status}`); } catch (error) { - console.error(`Erreur avec le buzzer ${buzzerName} (${ip}):`, error.message); + console.error(`[ERREUR] Erreur avec le buzzer ${buzzerName} (${ip}):`, error.message); } } }; @@ -36,5 +35,5 @@ client.on('connect', () => { }); client.on('error', (error) => { - console.error('Erreur de connexion au broker MQTT:', error.message); + console.error('[ERREUR] Erreur de connexion au broker MQTT:', error.message); });