settings: add entry to toggle debug mode

This commit is contained in:
Qingping Hou committed 2016-10-30 15:25:51 -07:00
1 parent a407036acd
commit 4540d51a6e
2 files changed
+5 -3

No files matched your search

+4 -3
View File
@@ -77,7 +77,8 @@ end
-- should check DEBUG option in arg and turn on DEBUG before loading other
-- modules, otherwise DEBUG in some modules may not be printed.
local DEBUG = require("dbg")
local dbg = require("dbg")
if G_reader_settings:readSetting("debug") then dbg:turnOn() end
local Profiler = nil
local ARGV = arg
@@ -95,9 +96,9 @@ while argidx <= #ARGV do
if arg == "-h" then
return showusage()
elseif arg == "-d" then
DEBUG:turnOn()
dbg:turnOn()
elseif arg == "-v" then
DEBUG:setVerbose(true)
dbg:setVerbose(true)
elseif arg == "-p" then
Profiler = require("jit.p")
Profiler.start("la")