mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-24 06:10:11 +00:00
21 lines
555 B
Lua
21 lines
555 B
Lua
-------------------------------------------------------------------------------
|
|
-- Prints logging information to console
|
|
--
|
|
-- @author Thiago Costa Ponte (thiago@ideais.com.br)
|
|
--
|
|
-- @copyright 2004-2013 Kepler Project
|
|
--
|
|
-------------------------------------------------------------------------------
|
|
|
|
local logging = require"logging"
|
|
|
|
function logging.console(logPattern)
|
|
return logging.new( function(self, level, message)
|
|
io.stdout:write(logging.prepareLogMsg(logPattern, os.date(), level, message))
|
|
return true
|
|
end)
|
|
end
|
|
|
|
return logging.console
|
|
|