Module system.log¶
The log module exposes functions for interacting with the logging subsystem.
The default system log is available under the root log table. Other logs
created through log.create can be accessed by indexing the log table with
the name of the log, e.g. log.mylog.info("hello"). Both the main and
subtables may also be called directly, e.g. log("test") or log.mylog("hello").
Index¶
Data
Constants for log levels. |
|
Function
Closes a log or stream for listening. |
|
Creates a new log. |
|
Writes a critical error message to the log. |
|
Writes a debug message to the log. |
|
Writes an error message to the log. |
|
Writes an info message to the log. |
|
Writes a notice message to the log. |
|
Opens a log for listening to messages. |
|
Removes a previously created log. |
|
Sets the TTY to output a log to. (Requires root) |
|
Writes a traceback error message to the log. |
|
Writes a warning message to the log. |
Class
Writes a message to the log. |
API Reference¶
- class system.log.log¶
Writes a message to the log.
for the syslog syscall for more information.
strings with \t.
-
staticmethod log(options?:
table, ...:any):unknown¶ Writes a message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod debug(options?:
table, ...:any):unknown¶ Writes a debug message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod info(options?:
table, ...:any):unknown¶ Writes an info message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod notice(options?:
table, ...:any):unknown¶ Writes a notice message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod warning(options?:
table, ...:any):unknown¶ Writes a warning message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
warn:
function¶
-
staticmethod error(options?:
table, ...:any):unknown¶ Writes an error message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod critical(options?:
table, ...:any):unknown¶ Writes a critical error message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
staticmethod traceback(message?:
string):unknown¶ Writes a traceback error message to the log.
- Parameters:
message? (
string) – A message to attach to the traceback
-
staticmethod log(options?:
-
system.log.debug(options?:
table, ...:any):unknown¶ Writes a debug message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.info(options?:
table, ...:any):unknown¶ Writes an info message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.notice(options?:
table, ...:any):unknown¶ Writes a notice message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.warning(options?:
table, ...:any):unknown¶ Writes a warning message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.warn:
function¶
-
system.log.error(options?:
table, ...:any):unknown¶ Writes an error message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.critical(options?:
table, ...:any):unknown¶ Writes a critical error message to the log.
for the syslog syscall for more information.
strings with \t.
- Parameters:
options? (
table) – A table of options to supply. See the documentation... (
any) – The values to print to the log, which will be concatenated as
-
system.log.traceback(message?:
string):unknown¶ Writes a traceback error message to the log.
- Parameters:
message? (
string) – A message to attach to the traceback
-
system.log.levels:
table¶ Constants for log levels.
-
system.log.create(name:
string, streamed?:boolean, file?:string): (result:table)¶ Creates a new log.
- Parameters:
name (
string) – The name of the log to createstreamed? (
boolean) – Whether to make the log available for streamingfile? (
string) – The path to the file to write the log to
- Returns:
result (
table) – A logger object fromlog.*
-
system.log.remove(name:
string):unknown¶ Removes a previously created log.
- Parameters:
name (
string) – The log to remove
-
system.log.open(name:
string, filter?:string): (result:number)¶ Opens a log for listening to messages.
openlog syscall docs for more info)
- Parameters:
name (
string) – The name of the log to listen tofilter? (
string) – A filter command to filter messages with (see the
- Returns:
result (
number) – An ID to identify the logged messages with
-
system.log.close(name:
string|number):unknown¶ Closes a log or stream for listening.
ID returned by
log.open.- Parameters:
name (
string|number) – The log name to close (closes all streams), or an
-
system.log.setTTY(name:
string, tty:TTY|nil, level?:number):unknown¶ Sets the TTY to output a log to. (Requires root)
- Parameters:
name (
string) – The log to set the TTY oftty (
TTY|nil) – The TTY to use, ornilto disablelevel? (
number) – The minimum log level to show messages