Page MenuHomeFreeBSD

Add Lua Logging module to FreeBSD ports tree and introduce Lua functions and modules to ports
Needs ReviewPublic

Authored by tuukka.pasanen_ilmi.fi on Oct 24 2025, 10:30 AM.
Tags
None
Referenced Files
F166647355: D53316.diff
Sat, Aug 15, 4:43 AM
F166647344: D53316.diff
Sat, Aug 15, 4:43 AM
Unknown Object (File)
Wed, Aug 12, 9:34 AM
Unknown Object (File)
Tue, Aug 4, 3:08 PM
Unknown Object (File)
Mon, Aug 3, 1:05 PM
Unknown Object (File)
Sun, Aug 2, 5:17 AM
Unknown Object (File)
Sat, Aug 1, 5:41 AM
Unknown Object (File)
Sun, Jul 26, 9:20 AM
Subscribers

Details

Reviewers
bapt
Group Reviewers
portmgr
Summary

Diff Introduces a Lua logging module to be used in FreeBSD ports. It is a port of the original LunarModules logging module, adapted to function independently and be compatible with current FreeBSD Lua (FLua). Tested on FreeBSD 14.3 and Flua 5.4.6

Test Plan

After patch is applied then it can be tested with script which under this and run with command LUA_PATH="/usr/ports/Mk/LuaScripts/?.lua;;" /usr/libexec/flua /usr/ports/Mk/LuaScripts/example.lua:

Example script (example.lua)

local Logging = require("logging")
local logger = Logging.new(nil, "INFO", true)
logger:log(logger.INFO, "This is INFO level and should be printed")

logger:setLevel(logger.WARN)
logger:info("This is INFO level and should not be printed")
logger:warn("This is WARN level and should be printed")
logger:error("This is ERROR level and should be printed")

local table = { a = 1, b = 2 }
logger:debug(table)
logger:info("val1='%s', val2=%d", "string value", 1234)

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped