Files
community_bridge/lib/shared/prints.lua
T
gononono64 84480f8939 dkm
Ripped a part utility folder and shoved it into a lib. Changed a lot of Utility prefixes to the modules name. This contains breaking changes. Scripts that use 0.2.0 will need to update to match the new format
2025-02-05 17:42:50 -06:00

25 lines
537 B
Lua

Prints = Prints or {}
local function printMessage(level, color, message)
if type(message) == 'table' then
message = json.encode(message)
end
print(color .. '[' .. level .. ']:', message)
end
Prints.Info = function(message)
printMessage('INFO', '^5', message)
end
Prints.Warn = function(message)
printMessage('WARN', '^3', message)
end
Prints.Error = function(message)
printMessage('ERROR', '^1', message)
end
Prints.Debug = function(message)
printMessage('DEBUG', '^2', message)
end
return Prints