Added debug logger.

This commit is contained in:
ThePendulum 2021-11-09 03:11:29 +01:00
parent 867354978d
commit 11225c7aa6
1 changed files with 4 additions and 0 deletions

View File

@ -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);