From a9d3c33af202fea776e70fdf5f214b4cc04082a4 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sat, 27 May 2023 21:17:31 -0400 Subject: [PATCH] Improved client bot logging --- Client/controllers/botController.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Client/controllers/botController.js b/Client/controllers/botController.js index 16b2945..b559b66 100644 --- a/Client/controllers/botController.js +++ b/Client/controllers/botController.js @@ -1,6 +1,7 @@ // Debug const { DebugBuilder } = require("../utilities/debugBuilder.js"); const log = new DebugBuilder("client", "clientController"); +const botLog = new DebugBuilder("client", "clientController:bot"); const spawn = require('child_process').spawn; const { resolve } = require("path"); @@ -30,7 +31,7 @@ exports.joinServer = async (req, res) => { const NGThreshold = req.body.NGThreshold ?? 50 // Joining the discord server - log.INFO("Join requested to: ", deviceId, channelId, clientId); + log.INFO("Join requested to: ", deviceId, channelId, clientId, presetName, NGThreshold); if (process.platform === "win32") { log.DEBUG("Starting Windows Python"); pythonProcess = await spawn('H:\\Logan\\Projects\\Python-Discord-Audio-Bot\\venv\\Scripts\\python.exe', [resolve(__dirname, "../pdab/main.py"), deviceId, channelId, clientId, '-n', NGThreshold], { cwd: resolve(__dirname, "../pdab/").toString() }); @@ -46,12 +47,12 @@ exports.joinServer = async (req, res) => { let fullOutput; pythonProcess.stdout.setEncoding('utf8'); pythonProcess.stdout.on("data", (data) => { - log.VERBOSE("From Process: ", data); + botLog.VERBOSE("From Process: ", data); fullOutput += data.toString(); }); pythonProcess.stderr.on('data', (data) => { - log.VERBOSE(`stderr: ${data}`); + botLog.VERBOSE(`stderr: ${data}`); fullOutput += data.toString(); });