From 74e87949845a66e4c494cabaa849e404e9b5e150 Mon Sep 17 00:00:00 2001 From: solareon <769465+solareon@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:13:14 +0000 Subject: [PATCH] refactor: remove compat event --- bridge/qb/server/events.lua | 18 ------------------ modules/logger.lua | 10 +++------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/bridge/qb/server/events.lua b/bridge/qb/server/events.lua index d5dccc160..57621e282 100644 --- a/bridge/qb/server/events.lua +++ b/bridge/qb/server/events.lua @@ -41,22 +41,4 @@ RegisterServerEvent('baseevents:leftVehicle', function(veh, seat, modelName, net event = 'Left' } TriggerClientEvent('QBCore:Client:VehicleInfo', src, data) -end) - ----Compatability event for logging ----@param name string source of the log. Usually a playerId or name of a script. ----@param title string the action or 'event' being logged. Usually a verb describing what the name is doing. Example: SpawnVehicle ----@param message string the message attached to the log ----@param color? string what color the message should be ----@param tagEveryone? boolean Whether a role tag should be applied to this log. Uses config variable for logging role ----@deprecated use logger module from qbx_core -RegisterNetEvent('qb-log:server:CreateLog', function(name, title, color, message, tagEveryone) - logger.log({ - source = GetInvokingResource() or "qbx_core", - webhook = name, - event = title, - message = message, - color = color, - tags = tagEveryone and config.logging.role or nil - }) end) \ No newline at end of file diff --git a/modules/logger.lua b/modules/logger.lua index d63f924de..430273a6b 100644 --- a/modules/logger.lua +++ b/modules/logger.lua @@ -1,4 +1,3 @@ -local loggingConfig = require 'config.server'.logging local isServer = IsDuplicityVersion() if not isServer then lib.print.error('cannot use the logger on the client') @@ -140,21 +139,18 @@ end ---@field source string source of the log. Usually a playerId or name of a resource. ---@field event string the action or 'event' being logged. Usually a verb describing what the name is doing. Example: SpawnVehicle ---@field message string the message attached to the log ----@field webhook? string Discord logs only. shortname of the webhook this log should send to. looks up via config +---@field webhook? string Discord logs only. url of the webhook this log should send to. looks up via config ---@field color? string Discord logs only. what color the message should be ---@field tags? string[] Discord logs only. tags in discord. Example: {'<@%roleid>', '@everyone'} ---Creates a log using either ox_lib logger, discord webhooks depending on convar ---@param log Log local function createLog(log) - if loggingConfig.enableWebhooks then - log.webhook = loggingConfig.webhook[log.webhook] or loggingConfig.webhook['default'] + if log.webhook then ---@diagnostic disable-next-line: param-type-mismatch discordLog(log) end - if loggingConfig.enableOxLogging then - lib.logger(log.source, log.event, log.message) - end + lib.logger(log.source, log.event, log.message) -- oxlib fails silently if logging isn't setup correctly. end return {