diff --git a/lua/gmod_integration/core/utils/sh_utils.lua b/lua/gmod_integration/core/utils/sh_utils.lua index 22b152d..4b735d4 100644 --- a/lua/gmod_integration/core/utils/sh_utils.lua +++ b/lua/gmod_integration/core/utils/sh_utils.lua @@ -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