Skip to content

Commit

Permalink
style: tightly scope configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
solareon committed Dec 6, 2023
1 parent a1658b5 commit bc16fa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/logger.lua
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bc16fa8

Please sign in to comment.