========== Module log ========== .. lua: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 :lua:meth:`dbus `, :lua:meth:`evdev `, :lua:meth:`event `, :lua:meth:`file `, :lua:meth:`hwinfo `, :lua:meth:`log `, :lua:meth:`lua `, :lua:meth:`misc `, :lua:meth:`os `, :lua:meth:`spawn `, :lua:meth:`udev `, :lua:meth:`xorg ` for more information about this type Properties ========== .. list-table:: :header-rows: 0 * - :lua:attr:`log_level ` - Log level * - :lua:attr:`log_target ` - Log target .. lua:attribute:: log_level: string :type: string Log level Read/write property for log level. Possible values are: "error", "warn", "info", "debug" .. lua:attribute:: log_target: object :type: object Log target Write only property used to set the log target. Any object with a :code:`write(string)` method could work. This module provides :lua:meth:`file_target` and :lua:meth:`stderr_target` for creating log targets that log to a file and stderr respectively. Methods ========== .. list-table:: :header-rows: 0 * - :lua:meth:`file_target(filename, overwrite) ` - Log target for file * - :lua:meth:`stderr_target() ` - Log target for stderr .. lua:method:: file_target(filename, overwrite) -> FileTarget :rtype: :lua:mod:`FileTarget ` :type filename: string :param filename: :type overwrite: bool :param overwrite: Log target for file Create a log target that writes to a file. .. lua:method:: stderr_target() -> StderrTarget :rtype: :lua:mod:`StderrTarget ` Log target for stderr Create a log target that writes to stderr.