feat: only log timestamp on debug

This commit is contained in:
Linventif 2025-05-27 19:15:27 +00:00
parent 6ceeaf1535
commit de480a8934

View File

@ -1,24 +1,29 @@
local function getTimeStamp()
if !gmInte.config.debug then return "" end
return os.date("[%Y-%m-%d %H:%M:%S]")
end
function gmInte.log(msg, debug)
if debug && !gmInte.config.debug then return end
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] " .. msg)
print(getTimeStamp() .. " [Gmod Integration] " .. msg)
end
// Log Error
function gmInte.logError(msg, debug)
if debug && !gmInte.config.debug then return end
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [ERROR] " .. msg)
print(getTimeStamp() .. " [Gmod Integration] [ERROR] " .. msg)
end
// Log Warning
function gmInte.logWarning(msg, debug)
if debug && !gmInte.config.debug then return end
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [WARNING] " .. msg)
print(getTimeStamp() .. " [Gmod Integration] [WARNING] " .. msg)
end
// Log Hint
function gmInte.logHint(msg, debug)
if debug && !gmInte.config.debug then return end
print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Gmod Integration] [HINT] " .. msg)
print(getTimeStamp() .. " [Gmod Integration] [HINT] " .. msg)
end
// Is Private IP