OpenWrt_Luci_Lua/Me_Lua/r13/MZLog.lua

15 lines
337 B
Lua
Raw Normal View History

2015-05-09 10:48:46 +00:00
module ("MZLog", package.seeall)
function log(...)
local posix = require("posix")
local util = require("luci.util")
local priority = arg[1]
if priority and tonumber(priority) then
posix.openlog("luci", "nep", LOG_USER)
for i = 2, arg.n do
posix.syslog(priority, util.serialize_data(arg[i]))
end
posix.closelog()
end
end