Created
May 31, 2024 20:02
-
-
Save itIsMaku/a603a23c34582464083ba0ce5d2bbcff to your computer and use it in GitHub Desktop.
logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local prefixes = { | |
['error'] = '^1[error] ^0', | |
['warn'] = '^3[warn] | ^0', | |
['info'] = '^2[info] | ^0', | |
['debug'] = '^5[debug] | ^0', | |
['verbose'] = '^6[verbose] | ^0' | |
} | |
log = {} | |
for name, prefix in pairs(prefixes) do | |
log[name] = function(content, ...) | |
print(prefix .. content:format(...)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment