Added debug logger.
This commit is contained in:
parent
867354978d
commit
11225c7aa6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue