Skip to content
SinisterRectus edited this page Nov 16, 2019 · 4 revisions

Used to log formatted messages to stdout (the console) or to a file. The dateTime argument should be a format string that is accepted by os.date. The file argument should be a relative or absolute file path or nil if no log file is desired. See the logLevel enumeration for acceptable log level values.

Constructor

Logger(level, dateTime, file)

Parameter Type Optional
level number
dateTime string
file string

Methods

log(level, msg, ...)

Parameter Type
level number
msg string
... *

If the provided level is less than or equal to the log level set on initialization, this logs a message to stdout as defined by Luvit's process module and to a file if one was provided on initialization. The msg, ... pair is formatted according to string.format and returned if the message is logged.

This method only operates on data in memory.

Returns: string


Clone this wiki locally