Improved client bot logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// Debug
|
// Debug
|
||||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||||
const log = new DebugBuilder("client", "clientController");
|
const log = new DebugBuilder("client", "clientController");
|
||||||
|
const botLog = new DebugBuilder("client", "clientController:bot");
|
||||||
|
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
const { resolve } = require("path");
|
const { resolve } = require("path");
|
||||||
@@ -30,7 +31,7 @@ exports.joinServer = async (req, res) => {
|
|||||||
const NGThreshold = req.body.NGThreshold ?? 50
|
const NGThreshold = req.body.NGThreshold ?? 50
|
||||||
|
|
||||||
// Joining the discord server
|
// 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") {
|
if (process.platform === "win32") {
|
||||||
log.DEBUG("Starting Windows Python");
|
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() });
|
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;
|
let fullOutput;
|
||||||
pythonProcess.stdout.setEncoding('utf8');
|
pythonProcess.stdout.setEncoding('utf8');
|
||||||
pythonProcess.stdout.on("data", (data) => {
|
pythonProcess.stdout.on("data", (data) => {
|
||||||
log.VERBOSE("From Process: ", data);
|
botLog.VERBOSE("From Process: ", data);
|
||||||
fullOutput += data.toString();
|
fullOutput += data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
pythonProcess.stderr.on('data', (data) => {
|
pythonProcess.stderr.on('data', (data) => {
|
||||||
log.VERBOSE(`stderr: ${data}`);
|
botLog.VERBOSE(`stderr: ${data}`);
|
||||||
fullOutput += data.toString();
|
fullOutput += data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user