Skip to content

Instantly share code, notes, and snippets.

@itIsMaku
Created May 31, 2024 20:02
Show Gist options
  • Save itIsMaku/a603a23c34582464083ba0ce5d2bbcff to your computer and use it in GitHub Desktop.
Save itIsMaku/a603a23c34582464083ba0ce5d2bbcff to your computer and use it in GitHub Desktop.
logger
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