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
2018-08-23 11:15:08 +02:00

25 lines
475 B
Lua

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