Initial commit
This commit is contained in:
17
logger.lua
Normal file
17
logger.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local Logger = {}
|
||||
|
||||
local print = require"cprint"
|
||||
|
||||
local COLORS = {
|
||||
err = "\x1b[31;49;1m",
|
||||
warn = "\x1b[33;49;1m",
|
||||
info = "\x1b[39;49;1m",
|
||||
}
|
||||
|
||||
COLOR_RESET = "\x1b[0m"
|
||||
|
||||
function Logger.log(msg_type, fmt, ...)
|
||||
print((COLORS[msg_type] or COLOR_RESET) .. msg_type .. ": " .. COLOR_RESET .. string.format(fmt, ...))
|
||||
end
|
||||
|
||||
return Logger
|
||||
Reference in New Issue
Block a user