fix debug on/off toggle

This commit is contained in:
chrox
2013-10-25 20:07:58 +08:00
parent 974927db54
commit 0cdc5b64f4

View File

@@ -19,12 +19,8 @@ local function LvDEBUG(lv, ...)
print("#"..line)
end
local function DEBUGBT()
DEBUG(debug.traceback())
end
function Dbg_mt.__call(dbg, ...)
LvDEBUG(math.huge, ...)
if dbg.is_on then LvDEBUG(math.huge, ...) end
end
function Dbg:turnOn()
@@ -42,6 +38,10 @@ function Dbg:logEv(ev)
self.ev_log:flush()
end
function Dbg:traceback()
LvDEBUG(math.huge, debug.traceback())
end
setmetatable(Dbg, Dbg_mt)
return Dbg