Logging Update
Updated resource generating plugin to handle new logging standards moving forward for all logging functions.
This commit is contained in:
parent
ac5f36df26
commit
d05b674efa
Binary file not shown.
|
|
@ -3,7 +3,7 @@
|
|||
"name": "CSTM-RESOURCE-GENERATOR",
|
||||
"displayName": "CSTM Five Alive Resource Generator",
|
||||
"description": "This is an internal tool to help you in creating a new basic lua resource for FiveAlive",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"engines": {
|
||||
"vscode": "^1.59.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
--BEGIN CONFIG
|
||||
--Global Constants
|
||||
local LOG_LEVEL = 4
|
||||
|
|
@ -35,8 +36,14 @@ AddEventHandler(RESOURCE_CODE..":ConfigUpdate_cl", function(cfg)
|
|||
end)
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
if tonumber(LOG_LEVEL) >= logLevel then
|
||||
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, message)
|
||||
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
local CLASS = "CHANGEME"--This is the name that the logging framework will use to display your logs in the correct manner
|
||||
--BEGIN CONFIG
|
||||
--GLOBAL CONSTANTS
|
||||
local LOG_LEVEL = 4
|
||||
|
|
@ -95,12 +96,24 @@ end)
|
|||
|
||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
||||
function Log(message, logLevel)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
if tonumber(LOG_LEVEL) >= logLevel then
|
||||
exports.SLF:LogToServer(RESOURCE_CODE, logLevel, message)
|
||||
exports.SLF:LogToServer(RESOURCE_CODE, logLevel, value)
|
||||
end
|
||||
end
|
||||
|
||||
function DisLog(message)
|
||||
local line = debug.getinfo(2, "l").currentline
|
||||
local name = debug.getinfo(2, "n").name
|
||||
if name == "fn" then
|
||||
name = "Thread"
|
||||
end
|
||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||
exports.SLF:LogServerToDiscord(RESOURCE_CODE, message)
|
||||
end
|
||||
|
||||
|
|
|
|||
Reference in New Issue