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 Fri, Oct 24, 10:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 24, 8:56 PM
Unknown Object (File)
Fri, Oct 24, 3:52 PM
Unknown Object (File)
Fri, Oct 24, 3:24 PM
Unknown Object (File)
Fri, Oct 24, 2:34 PM
Unknown Object (File)
Fri, Oct 24, 1:55 PM
Unknown Object (File)
Fri, Oct 24, 1:30 PM
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