46 lines
1.1 KiB
Lua
Raw Permalink Normal View History

2025-01-04 23:00:19 +08:00
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by LT.
--- DateTime: 2023/10/29 15:49
---
UGCLogSystem = UGCLogSystem or {}
UGCLogSystem.EnableLog = true
function UGCLogSystem.SetEnableLog(isEnable)
UGCLogSystem.EnableLog = isEnable
end
function UGCLogSystem.LogTag()
return "[UGCLogSystem] " .. (UGCGameSystem.IsServer() and "[Server]" or "[Client]")
end
function UGCLogSystem.Print(Log)
if not UGCLogSystem.EnableLog then return end
print(Log)
end
function UGCLogSystem.Log(Fmt, ...)
if not UGCLogSystem.EnableLog then return end
local LogStr = UGCLogSystem.LogTag()..string.format(Fmt, ...)
UGCLogSystem.Print(LogStr)
end
function UGCLogSystem.LogTree(Fmt, OutTable)
if not UGCLogSystem.EnableLog then return end
log_tree(Fmt, OutTable)
end
function UGCLogSystem.UGCLog(Fmt, ...)
if not UGCLogSystem.EnableLog then return end
ugcprint(string.format(Fmt, ...));
end
function UGCLogSystem.LogError(Fmt, ...)
if not UGCLogSystem.EnableLog then return end
local LogStr = UGCLogSystem.LogTag().."[LogicError]"..string.format(Fmt, ...)
UGCLogSystem.Print(LogStr)
end