From 7aca72f26cdb48f6ab5f0a2ecad0614a12377b69 Mon Sep 17 00:00:00 2001 From: Mirmidion <74191079+Mirmidion@users.noreply.github.com> Date: Fri, 14 Oct 2022 08:58:25 +0200 Subject: [PATCH] Replaced hardcoded log path with given parameter path --- SignallingWebServer/modules/logging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignallingWebServer/modules/logging.js b/SignallingWebServer/modules/logging.js index 9482c581..ba3b2e0e 100644 --- a/SignallingWebServer/modules/logging.js +++ b/SignallingWebServer/modules/logging.js @@ -60,12 +60,12 @@ function timeToString() { function RegisterFileLogger(path) { if(path == null) - path = './'; + path = './logs/'; if (!fs.existsSync(path)) fs.mkdirSync(path); - var output = fs.createWriteStream(`./logs/${dateTimeToString()}.log`); + var output = fs.createWriteStream(`${path}${dateTimeToString()}.log`); var fileLogger = new Console(output); logFunctions.push(function(msg, ...args) { fileLogger.log(`${timeToString()} ${msg}`, ...args);