From: Petr Špaček Date: Tue, 16 Apr 2019 06:29:17 +0000 (+0200) Subject: table_print: also print function addresses X-Git-Tag: v4.0.0~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b6d151a50d491f49811499c1eb037fc7da952a1;p=thirdparty%2Fknot-resolver.git table_print: also print function addresses It gets handy for debugging, especially when looking at dufferent callback "instances". --- diff --git a/daemon/lua/sandbox.lua.in b/daemon/lua/sandbox.lua.in index 4380d50a6..b2b26c431 100644 --- a/daemon/lua/sandbox.lua.in +++ b/daemon/lua/sandbox.lua.in @@ -442,8 +442,9 @@ function table_print (tt, indent, done) result = result .. string.rep (" ", indent) result = result .. "}\n" elseif type (value) == "function" then - result = result .. string.format("[%s] => function %s%s\n", - tostring(key), tostring(key), funcsign(value)) + result = result .. string.format("[%s] => function %s%s: %s\n", + tostring(key), tostring(key), funcsign(value), + string.sub(tostring(value), 11)) else result = result .. string.format("[%s] => %s\n", tostring (key), printable(value)) @@ -452,7 +453,8 @@ function table_print (tt, indent, done) else -- not a table local tt_str if type(tt) == "function" then - tt_str = string.format("function%s\n", funcsign(tt)) + tt_str = string.format("function%s: %s\n", funcsign(tt), + string.sub(tostring(tt), 11)) else tt_str = tostring(tt) end