Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Log globals
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local mt = getmetatable(_G) or {} local function print(val) if type(val) == "table" then local printout = {} local i = 1 for k, v in pairs(val) do table.insert(printout, ("[%s] = %s"):format(tostring(k), tostring(v)) ) i = i + 1 if i > 5 then table.insert(printout, "...") break end end printout = { table.concat(printout, ", ") } table.insert(printout, 1, "{") table.insert(printout, "}") return table.concat(printout) elseif type(val) == "string" then return '"' .. val .. '"' else return tostring(val) end end mt.__newindex = function (self, key, value) if key ~= "arg" then mw.log("Global variable " .. print(key) .. " was set to " .. print(value) .. " somewhere:", debug.traceback("", 2)) end return rawset(self, key, value) end mt.__index = function (self, key) if key ~= "arg" then mw.log("Nil global variable " .. print(key) .. " was read somewhere:", debug.traceback("", 2)) end return rawget(self, key) end setmetatable(_G, mt)
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.
Templates used on this page:
Template:Error
(
edit
)
Template:Ml-lua
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Pp
(
edit
)
Template:Protection padlock
(
edit
)
Template:Sandbox other
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Template:Transclusionless
(
edit
)
Module:Error
(
edit
)
Module:File link
(
edit
)
Module:Log globals/doc
(
edit
)
Module:Message box
(
edit
)
Module:Protection banner
(
edit
)
Module:String
(
edit
)