1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00
antd-web-apps/silk/BaseObject.lua

25 lines
475 B
Lua
Raw Normal View History

2018-08-22 19:38:36 +02:00
BaseObject = Object:extends{registry = {}, class="BaseObject"}
function BaseObject:log(msg, level)
level = level or "INFO"
if self.registry.logger then
self.registry.logger:log(msg,level)
end
end
function BaseObject:debug(msg)
self:log(msg, "DEBUG")
end
function BaseObject:error(msg, trace)
html()
echo(msg)
self:log(msg,"ERROR")
if trace then
debug.traceback=nil
error(msg)
else
error(msg)
end
end