-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Nice wee module! I've learned a lot from it. Many thanks.
Some minor changes you could make:
-
if you change function spec of log.level from
log[x.name] = function(...)tolog[x.name] = function(fmt, ...)you can then append fmt to your format stringprint(string.format("%s[%-6s%s]%s %s: " .. fmt, ...)and allow the calls to use param substitution e.g:log.error("Some error no: %d", errno) -
Add export log.levels = levels so the list of level strings can be accessed and tested against :
if log.levels[level] thenetc -
Add function log.log() where first param is level makes dynamic level change easy:
log.log = function(level, ...) if levels[level] then log[level](...) else log[log.level](...) end end
theoparis
Metadata
Metadata
Assignees
Labels
No labels