From 53e5196bd3c100725d793bbd3f959a2297379206 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 17 Apr 2012 17:39:19 +0200 Subject: [PATCH] simple debug function which knows how to dump tables --- settings.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/settings.lua b/settings.lua index fb379743f..c9f7c3ffa 100644 --- a/settings.lua +++ b/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