Module log
System logging library
Usage:
local log = require("log")("My Library")
log.debug("This is worthless to read except when debugging")
log.info("This is some general information")
log.warn("This should be noticed")
log.error("Critical situation!")
-
fileLogger (path)
-
Returns a logger that logs to the file specified by path
Parameters:
- path
string
The path of the file to write to
Returns:
loghandler
-
logger.log (msg, level)
-
Log a message with the given level, instead of doing that, specialized
methods (logger.debug, logger.info, ...) should be privileged
Parameters:
- msg
string
The message to log
- level
int
The level of the message
Usage:
local log = require("log")
local logger = log("My Library")
logger.log("Hello", log.INFO_LEVEL)
-
logger.debug (msg)
-
Log a message with a debug level
Parameters:
-
logger.info (msg)
-
Log a message with an information level
Parameters:
-
logger.warn (msg)
-
Log a message with a warning level
Parameters:
-
logger.error (msg)
-
Log a message with a error level
Parameters:
-
logHandlers
-
List of loghandlers
-
DEBUG_LEVEL
-
Debug level
-
INFO_LEVEL
-
Info level
-
WARN_LEVEL
-
Warning level
-
ERROR_LEVEL
-
Error level