Module log

Logging

This module can also be called like a method, it takes 2 arguments, the log level and the log string, and log them to the log target.

See dbus, evdev, event, file, hwinfo, log, lua, misc, os, spawn, udev, xorg for more information about this type

Properties

log_level

Log level

log_target

Log target

log_level: string
Type:

string

Log level

Read/write property for log level. Possible values are: “error”, “warn”, “info”, “debug”

log_target: object
Type:

object

Log target

Write only property used to set the log target. Any object with a write(string) method could work. This module provides file_target() and stderr_target() for creating log targets that log to a file and stderr respectively.

Methods

file_target(filename, overwrite)

Log target for file

stderr_target()

Log target for stderr

file_target(filename, overwrite) FileTarget
Return type:

FileTarget

Parameters:
  • filename (string)

  • overwrite (bool)

Log target for file

Create a log target that writes to a file.

stderr_target() StderrTarget
Return type:

StderrTarget

Log target for stderr

Create a log target that writes to stderr.