OpenWrt_Luci_Lua/Me_Lua/h13/MZLog.lua
2015-05-09 18:55:09 +08:00

15 lines
337 B
Lua

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