GitHunt
DE

Desiment/logger.lua

A tiny logging module for Lua

logger.lua

A tiny logging module for Lua.

Installation

The logger.lua file should be dropped into an existing project
and required by it.

log = require "logger"

Basic usage

Basically, log.lua provides 7 modes: trace, debug, info, success, warning, error, fatal. Each mode represnted
by function which takes all its arguments, concatenates them into a string and then writes them with some additional info into the log.

Small example of this:

> log.trace("Trace message")
[TRACE   03:39:53] demo_1.lua:3:  Trace message

Also, there is method for converting tables (possibly nested) into string: log.dump(table).

Finally, there for automatic registration of function calls. See tests for example.

Languages

Lua100.0%

Contributors

GNU General Public License v3.0
Created February 19, 2023
Updated February 19, 2023
Desiment/logger.lua | GitHunt