打印lua中全局变量的一段代码

function printTableItem(k, v, level)
for i = , level do
io.write(" ")
end
io.write(tostring(k), " = ", tostring(v), "\n")
if type(v) == "table" then
if not tablePrinted[v] then
tablePrinted[v] = true
for k, v in pairs(v) do
printTableItem(k, v, level + )
end
end
end
end
printTableItem("_G", _G, )
上一篇:Struts国际化


下一篇:日志分析工具Log Parser介绍