From 0cdc5b64f4365bbc4dafd0552db7f9ea07923496 Mon Sep 17 00:00:00 2001 From: chrox Date: Fri, 25 Oct 2013 20:07:58 +0800 Subject: [PATCH] fix debug on/off toggle --- frontend/dbg.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/dbg.lua b/frontend/dbg.lua index 071b6e35f..e9a52dfc0 100644 --- a/frontend/dbg.lua +++ b/frontend/dbg.lua @@ -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