From 11225c7aa6739a1b87a019875cabf0ddea7679ae Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Tue, 9 Nov 2021 03:11:29 +0100 Subject: [PATCH] Added debug logger. --- src/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.js b/src/app.js index a729973..a25201c 100644 --- a/src/app.js +++ b/src/app.js @@ -9,6 +9,8 @@ const logger = require('simple-node-logger').createSimpleLogger(); const points = {}; +logger.setLevel('debug'); + async function auth() { const httpSession = bhttp.session(); const username = config.uniqueUsername ? `${config.user.username}-${new Date().getTime().toString().slice(-5)}` : config.user.username; @@ -255,6 +257,8 @@ async function connect(wsCreds, sessionCookie, bot, games) { socket.ws.on('message', async (msg) => { const [domain, data] = JSON.parse(msg); + logger.debug(`Received ${domain}: ${JSON.stringify(data)}`); + if (messageHandlers[domain]) { try { await messageHandlers[domain](data, bot, games);