From e1b6ca8803ae712d6f0f9d77b105cdeee8459ac0 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 24 Aug 2024 16:58:27 +0200 Subject: [PATCH] Change serverconsole.js, so it no longer exports the constructor, just serverconsole object. --- src/index.js | 4 +--- src/utils/serverconsole.js | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/index.js b/src/index.js index a8a04c0..cca0305 100644 --- a/src/index.js +++ b/src/index.js @@ -77,7 +77,7 @@ if (process.serverConfig.optOutOfStatisticsServer === undefined) process.serverC process.serverConfig.version = version; // Compatiblity for very old SVR.JS mods -const serverconsoleConstructor = require("./utils/serverconsole.js"); +const serverconsole = require("./utils/serverconsole.js"); let inspectorURL = undefined; try { @@ -103,8 +103,6 @@ try { wwwrootError = err; } -const serverconsole = serverconsoleConstructor(process.serverConfig.enableLogging); - let middleware = [ require("./middleware/core.js"), require("./middleware/urlSanitizer.js"), diff --git a/src/utils/serverconsole.js b/src/utils/serverconsole.js index e7f588d..2bd8f32 100644 --- a/src/utils/serverconsole.js +++ b/src/utils/serverconsole.js @@ -1,6 +1,6 @@ const fs = require("fs"); -let enableLoggingIntoFile = false; +let enableLoggingIntoFile = process.serverConfig.enableLogging; let logFile = undefined; let logSync = false; let cluster = require("./clusterBunShim.js"); @@ -271,7 +271,4 @@ process.exit = function (code) { } }; -module.exports = (enableLoggingIntoFileParam) => { - enableLoggingIntoFile = enableLoggingIntoFileParam; - return serverconsole; -}; +module.exports = serverconsole;