Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Core
(view source)
Revision as of 11:45, 22 November 2017
510 bytes added
,
7 years ago
no edit summary
Line 175:
Line 175:
function Utils.requireModule(name)
function Utils.requireModule(name)
return pcall(function () return require(string.format("Module:%s", name)) end)
return pcall(function () return require(string.format("Module:%s", name)) end)
+
end
+
+
-- * Testing functions.
+
+
function Utils.debugPrint(x, i)
+
i = i or 0
+
if type(x) == "table" then
+
for k, v in pairs(x) do
+
mw.log(
+
string.rep(" ", i) .. tostring(k) .. " : " .. type(k) .. " = " ..
+
(type(v) == "table" and "table" or tostring(v) .. " : " .. type(v))
+
)
+
if type(v) == "table" then
+
debugPrint(v, i + 1)
+
end
+
end
+
else
+
mw.log(tostring(x) .. " : " .. type(x))
+
end
end
end
がか
cssedit, gkautomate
7,064
edits