settings: add entry to toggle debug mode

pull/2310/head
Qingping Hou 8 years ago
parent a407036acd
commit 4540d51a6e

@ -2,6 +2,7 @@ local dump = require("dump")
local isAndroid, android = pcall(require, "android")
local Dbg = {
-- set to nil so first debug:turnOff call won't be skipped
is_on = nil,
is_verbose = nil,
ev_log = nil,

@ -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")

Loading…
Cancel
Save