mirror of
https://github.com/gmod-integration/lua.git
synced 2025-06-15 13:53:59 +00:00
feat: only log timestamp on debug
This commit is contained in:
parent
6ceeaf1535
commit
de480a8934
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user