SLF Updates

This commit is contained in:
Chase Eller 2026-03-25 17:41:35 -04:00
parent 8252d42b6a
commit bf3e99a6fe
No known key found for this signature in database
GPG Key ID: 9233D42F495E657C
7 changed files with 36 additions and 8 deletions

View File

@ -26,3 +26,7 @@ I will use this area to keep up with what i did last.
- Updated snippets for SLF to align with new coding processes - Updated snippets for SLF to align with new coding processes
- Updated templates for resource builder to build to new coding process - Updated templates for resource builder to build to new coding process
## [Release 1.1.4]
- Updated logging functions on all scripts and snippets to allow for the new on the fly log change.

View File

@ -2,7 +2,7 @@
"name": "cstmgames-fivem-snippets", "name": "cstmgames-fivem-snippets",
"displayName": "CSTMGames FiveM Dev Tools", "displayName": "CSTMGames FiveM Dev Tools",
"description": "Development tools for FiveM", "description": "Development tools for FiveM",
"version": "1.1.3", "version": "1.1.4",
"author": { "author": {
"name": "Chase Eller", "name": "Chase Eller",
"email": "chase@cstmgames.com", "email": "chase@cstmgames.com",

View File

@ -39,7 +39,7 @@
], ],
"description": "Sets up command to be registered" "description": "Sets up command to be registered"
}, },
"SLF Functions and Vars for SERVER.": { "SLF Functions and Vars for server.": {
"prefix": "SLFSERVER", "prefix": "SLFSERVER",
"body": [ "body": [
"--GLOBAL CONSTANTS", "--GLOBAL CONSTANTS",
@ -77,11 +77,15 @@
" end", " end",
" local value = \"{\"..CLASS..\".\"..name..\"(\"..line..\")} \"..message", " local value = \"{\"..CLASS..\".\"..name..\"(\"..line..\")} \"..message",
" exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)", " exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)",
"end" "end",
"RegisterNetEvent(RESOURCE_CODE..\":UpdateLogLevel\")",
"AddEventHandler(RESOURCE_CODE..\":UpdateLogLevel\", function(num)",
" LOG_LEVEL = num",
"end)"
], ],
"description": "SLF Functions and Vars for SERVER." "description": "SLF Functions and Vars for server."
}, },
"SLF Functions and Vars for CLIENT.": { "SLF Functions and Vars for client.": {
"prefix": "SLFCLIENT", "prefix": "SLFCLIENT",
"body": [ "body": [
"--GLOBAL CONSTANTS", "--GLOBAL CONSTANTS",
@ -108,7 +112,11 @@
" exports.SLF:LogToClient(RESOURCE_CODE, 4, value)", " exports.SLF:LogToClient(RESOURCE_CODE, 4, value)",
" Log(\"Warning line was logged without a level value... Logged it as debug as that is the safest route.\", 1)", " Log(\"Warning line was logged without a level value... Logged it as debug as that is the safest route.\", 1)",
" end", " end",
"end" "end",
"RegisterNetEvent(RESOURCE_CODE..\":UpdateLogLevel\")",
"AddEventHandler(RESOURCE_CODE..\":UpdateLogLevel\", function(num)",
" LOG_LEVEL = num",
"end)"
], ],
"description": "SLF Functions and Vars for client." "description": "SLF Functions and Vars for client."
}, },

View File

@ -23,7 +23,10 @@ local function Log(message, logLevel)
Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1) Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1)
end end
end end
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
LOG_LEVEL = num
end)
--LOCAL VARIABLES --LOCAL VARIABLES
--END CONFIG --END CONFIG

View File

@ -34,6 +34,11 @@ local function DisLog(message)
local value = "{"..CLASS.."."..name.."("..line..")} "..message local value = "{"..CLASS.."."..name.."("..line..")} "..message
exports.SLF:LogServerToDiscord(RESOURCE_CODE, message) exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)
end end
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
LOG_LEVEL = num
end)
--Global Variables --Global Variables
--LOCAL VARIABLES --LOCAL VARIABLES

View File

@ -23,6 +23,10 @@ local function Log(message, logLevel)
Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1) Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1)
end end
end end
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
LOG_LEVEL = num
end)
--LOCAL VARIABLES --LOCAL VARIABLES

View File

@ -34,6 +34,10 @@ local function DisLog(message)
local value = "{"..CLASS.."."..name.."("..line..")} "..message local value = "{"..CLASS.."."..name.."("..line..")} "..message
exports.SLF:LogServerToDiscord(RESOURCE_CODE, message) exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)
end end
RegisterNetEvent(RESOURCE_CODE..":UpdateLogLevel")
AddEventHandler(RESOURCE_CODE..":UpdateLogLevel", function(num)
LOG_LEVEL = num
end)
--Global Variables --Global Variables
--LOCAL VARIABLES --LOCAL VARIABLES