From bc16fa8435608de33f6e0f3f141a5c2d3a16fad9 Mon Sep 17 00:00:00 2001 From: solareon <769465+solareon@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:10:21 +0000 Subject: [PATCH] style: tightly scope configuration --- modules/logger.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/logger.lua b/modules/logger.lua index 417809484..d63f924de 100644 --- a/modules/logger.lua +++ b/modules/logger.lua @@ -1,4 +1,4 @@ -local config = require 'config.server' +local loggingConfig = require 'config.server'.logging local isServer = IsDuplicityVersion() if not isServer then lib.print.error('cannot use the logger on the client') @@ -147,12 +147,12 @@ end ---Creates a log using either ox_lib logger, discord webhooks depending on convar ---@param log Log local function createLog(log) - if config.logging.enableWebhooks then - log.webhook = config.logging.webhook[log.webhook] or config.logging.webhook['default'] + if loggingConfig.enableWebhooks then + log.webhook = loggingConfig.webhook[log.webhook] or loggingConfig.webhook['default'] ---@diagnostic disable-next-line: param-type-mismatch discordLog(log) end - if config.logging.enableOxLogging then + if loggingConfig.enableOxLogging then lib.logger(log.source, log.event, log.message) end end