log
Log library provides logging facilities.
local log = require"log"
log("MODULE", "INFO", "message")
calls the #log.trace function.
levels
levels.ALL | 7 |
levels.DEBUG | 6 |
levels.DETAIL | 5 |
levels.ERROR | 2 |
levels.INFO | 4 |
levels.NONE | 1 |
levels.WARNING | 3 |
log
log.defaultlevel | Default verbosity level. |
log.displaylogger(severity, msg) | Default logger for instant display. |
log.format | Format is a string used to apply specific formating before the log is outputted. |
log.modules | Per module verbosity levels. |
log.musttrace(severity) | Determines whether a log must be traced depending on its severity and the module. |
log.setlevel(slevel, varargs) | Sets the log level for a list of module names. |
log.storelogger(severity, msg) | Logger function for log storage. |
log.trace(severity, fmt) | Prints out a log entry according to the module and the severity of the log entry. |
levels
Severity name <-> Severity numeric value translation table.
Built-in values (in order from the least verbose to the most):
levels.ALL
levels.DEBUG
levels.DETAIL
levels.ERROR
levels.INFO
levels.NONE
levels.WARNING
log
log.defaultlevel
log.displaylogger(severity, msg)
severity
:
string representing the log level.
msg
:
string containing the message to log.
log.format
log.modules
log.musttrace(severity)
severity
:
string representing the log level.
log.setlevel(slevel, varargs)
slevel
:
level as in #levels
varargs
:
Optional list of modules names (string) to apply the level to.
nothing.
log.storelogger(severity, msg)
severity
:
string representing the log level.
msg
:
string containing the message to log.
log.trace(severity, fmt)
severity
:
string representing the log level.
fmt
:
string format that holds the log text the same way as string.format does.
trace("MODULE", "INFO", "message=%s", "sometext").