Lua log file: Fix list handling

This commit is contained in:
Lars Mueller 2021-09-19 11:03:21 +02:00
parent 29f7960464
commit 77ac8ba640

@ -142,12 +142,9 @@ local function _dump(self, value, is_key)
create_reference() create_reference()
-- TODO traverse tables to determine whether this is actually needed -- TODO traverse tables to determine whether this is actually needed
self:log(key .. "={}") self:log(key .. "={}")
local tablelen = #value
for k, v in pairs(value) do for k, v in pairs(value) do
if type(k) ~= "number" or k % 1 ~= 0 or k < 1 or k > tablelen then local dumped, short = _dump(self, k, true)
local dumped, short = _dump(self, k, true) self:log(key .. (short and ("." .. dumped) or ("[" .. dumped .. "]")) .. "=" .. _dump(self, v))
self:log(key .. (short and ("." .. dumped) or ("[" .. dumped .. "]")) .. "=" .. _dump(self, v))
end
end end
else else
error("unsupported type: " .. _type) error("unsupported type: " .. _type)