Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Replaced hardcoded log path with given parameter path
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirmidion committed Nov 13, 2022
1 parent f1bad5b commit 7aca72f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SignallingWebServer/modules/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7aca72f

Please sign in to comment.