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
25 lines
537 B
Lua
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 |