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

Replaced hardcoded log path with given parameter path #39

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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