From 5b487125aa0e733819c81c1875c66cbba92badf9 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 12 Feb 2025 07:51:27 -0700 Subject: [PATCH] Update some logging stuff --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d626bb8..08c1246 100644 --- a/index.js +++ b/index.js @@ -377,13 +377,14 @@ xmpp.on("stanza", (stanza) => { const now = new Date(); const diff = (now - product_id.timestamp) / 1000 / 60; if (diff > 3) return; - if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} New message from ${fromChannel}`); + // if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} New message from ${fromChannel}`); + console.log(`${colors.cyan("[INFO]")} ${getWFO(fromChannel)?.location || fromChannel} issues ${evt.name}`) messages++; // Handle NTFY if (config.ntfy.enabled) { - if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} Sending NTFY for ${config.ntfy.prefix}${fromChannel}`) + //if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} Sending NTFY for ${config.ntfy.prefix}${fromChannel}`) ntfyBody = { "topic": `${config.ntfy.prefix}${fromChannel}`, "message": bodyData.string, @@ -401,7 +402,7 @@ xmpp.on("stanza", (stanza) => { 'Authorization': `Bearer ${config.ntfy.token}` } }).then((res) => { - if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} NTFY sent for ${config.ntfy.prefix}${fromChannel} with status ${res.status} ${res.statusText}`); + //if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} NTFY sent for ${config.ntfy.prefix}${fromChannel} with status ${res.status} ${res.statusText}`); if (res.status !== 200) console.log(`${colors.red("[ERROR]")} NTFY failed for ${config.ntfy.prefix}${fromChannel} with status ${res.status} ${res.statusText}`);