mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-23 22:00:11 +00:00
15 lines
337 B
Lua
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
|