A minimal logging module for Lua with six severity levels, console colors, and optional file output.
log.lua is a tiny logging module for Lua that provides six severity-based logging functions (trace, debug, info, warn, error, fatal) with configurable output options. It solves the need for a simple, dependency-free logging solution in Lua projects, offering both console output with ANSI colors and optional file logging.
Lua developers who need a straightforward, minimal logging library for debugging, monitoring, or outputting structured messages in their applications.
Developers choose log.lua for its extreme simplicity, single-file integration, and essential features like log levels and colored output without the overhead of larger logging frameworks.
A tiny logging module for Lua
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As a single-file module, it can be dropped into any Lua project without dependencies, making setup trivial and alignment with its minimalist philosophy.
Offers six severity levels with a settable minimum level (log.level), allowing fine-grained control to filter out less important messages like trace or debug.
Supports ANSI colors via log.usecolor for better visual distinction of log levels in terminals, enhancing readability during debugging.
Allows logging to a file with full timestamps by setting log.outfile, automatically creating or appending to the file, which is useful for persistence.
Missing advanced features like log rotation, structured output formats (e.g., JSON), or remote logging, which are common in more comprehensive libraries.
The README does not mention error handling for file operations, potentially leading to silent failures if the log file cannot be written or accessed.
With only three configuration options (usecolor, outfile, level), it may not suffice for projects needing complex setups or custom output formats.