mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
simple debug function which knows how to dump tables
This commit is contained in:
12
settings.lua
12
settings.lua
@@ -23,6 +23,18 @@ function dump(data)
|
||||
return table.concat(out)
|
||||
end
|
||||
|
||||
function debug(...)
|
||||
local line = ""
|
||||
for i,v in ipairs(arg) do
|
||||
if type(v) == "table" then
|
||||
line = line .. dump(v)
|
||||
else
|
||||
line = line .. tostring(v)
|
||||
end
|
||||
end
|
||||
print("# "..line)
|
||||
end
|
||||
|
||||
-- simple serialization function, won't do uservalues, functions, loops
|
||||
function DocSettings:_serialize(what, outt, indent)
|
||||
if type(what) == "table" then
|
||||
|
||||
Reference in New Issue
Block a user