From d2ac91365c9dbaf76c4a806b967e27f9840cb276 Mon Sep 17 00:00:00 2001 From: Mitchdev Date: Mon, 22 Jan 2024 22:07:14 +1300 Subject: [PATCH] Fix logger info context --- lib/services/dgg-rolling-chat-cache.js | 4 ++-- lib/services/spam-detection.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/dgg-rolling-chat-cache.js b/lib/services/dgg-rolling-chat-cache.js index 5016aa5..86ceaff 100644 --- a/lib/services/dgg-rolling-chat-cache.js +++ b/lib/services/dgg-rolling-chat-cache.js @@ -24,7 +24,7 @@ class ChatCache { this.tombStoneMap = {}; this.startTombStoneInterval(); - this.logger.info('Config loaded for Chat Cache:', config); + this.logger.info(config, 'Config loaded for Chat Cache'); } startTombStoneInterval() { @@ -86,7 +86,7 @@ class ChatCache { return; } this.messageMatching.getLinks(message).forEach((link) => { - this.logger.info('Cached viewer url:', { user, url: link.hostname + link.pathname, message }); + this.logger.info({ user, url: link.hostname + link.pathname, message }, 'Cached viewer url'); if (!_.has(this.viewerUrlMap, user)) this.viewerUrlMap[user] = []; this.viewerUrlMap[user].push({ url: link.hostname + link.pathname, diff --git a/lib/services/spam-detection.js b/lib/services/spam-detection.js index 4b4d80f..3f4e660 100644 --- a/lib/services/spam-detection.js +++ b/lib/services/spam-detection.js @@ -30,7 +30,7 @@ class SpamDetection { this.longWordAllowedSpaces = 4; this.messageUrlSpamCount = config.messageUrlSpamCount || 3; - this.logger.info('Config loaded for Spam Detection:', config); + this.logger.info(config, 'Config loaded for Spam Detection'); } // Checks whether there's a large number of non ascii characters