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;