Updates to handle new logging
This commit is contained in:
parent
fbb704ff4e
commit
171aec503c
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "CSTM-RESOURCE-GENERATOR",
|
"name": "CSTM-RESOURCE-GENERATOR",
|
||||||
"displayName": "CSTM Five Alive 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",
|
"description": "This is an internal tool to help you in creating a new basic lua resource for FiveAlive",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.59.0"
|
"vscode": "^1.59.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@ local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_co
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing
|
||||||
|
|
||||||
|
---Used to send logs to the client console
|
||||||
|
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||||
|
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||||
function Log(message, logLevel)
|
function Log(message, logLevel)
|
||||||
local line = debug.getinfo(2, "l").currentline
|
local line = debug.getinfo(2, "l").currentline
|
||||||
local name = debug.getinfo(2, "n").name
|
local name = debug.getinfo(2, "n").name
|
||||||
|
|
@ -27,9 +31,14 @@ function Log(message, logLevel)
|
||||||
name = "Thread"
|
name = "Thread"
|
||||||
end
|
end
|
||||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||||
|
if logLevel then
|
||||||
if tonumber(LOG_LEVEL) >= logLevel then
|
if tonumber(LOG_LEVEL) >= logLevel then
|
||||||
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)
|
exports.SLF:LogToClient(RESOURCE_CODE, logLevel, value)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
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)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function GetSID(UUID)
|
function GetSID(UUID)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ local RESOURCE_CODE = GetResourceMetadata(GetCurrentResourceName(), "resource_co
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
||||||
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
--SLF Server Logging Function DO NOT TOUCH unless you know what you are doing.
|
||||||
|
|
||||||
|
---Used to send logs to the server console
|
||||||
|
---@param message any Preformatted message or VARIABLES to be sent to log
|
||||||
|
---@param logLevel integer Level of log, 1-Error, 2-Warn, 3-Info, 4-Debug
|
||||||
function Log(message, logLevel)
|
function Log(message, logLevel)
|
||||||
local line = debug.getinfo(2, "l").currentline
|
local line = debug.getinfo(2, "l").currentline
|
||||||
local name = debug.getinfo(2, "n").name
|
local name = debug.getinfo(2, "n").name
|
||||||
|
|
@ -27,9 +31,14 @@ function Log(message, logLevel)
|
||||||
name = "Thread"
|
name = "Thread"
|
||||||
end
|
end
|
||||||
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
local value = "{"..CLASS.."."..name.."("..line..")} "..message
|
||||||
|
if logLevel then
|
||||||
if tonumber(LOG_LEVEL) >= logLevel then
|
if tonumber(LOG_LEVEL) >= logLevel then
|
||||||
exports.SLF:LogToServer(RESOURCE_CODE, logLevel, value)
|
exports.SLF:LogToServer(RESOURCE_CODE, logLevel, value)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
exports.SLF:LogToServer(RESOURCE_CODE, 4, value)
|
||||||
|
Log("Warning line was logged without a level value... Logged it as debug as that is the safest route.", 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function DisLog(message)
|
function DisLog(message)
|
||||||
|
|
|
||||||
Reference in New Issue