Module:UtilsError

local p = {}

function p.warn(msg, level) local callStack = debug.traceback("", 2 + (level or 0)) local output = msg .. "\n\n" for line in string.gmatch(callStack, "\tModule:[^:]*:[^\n]*\n") do		line = string.gsub(line, "\tModule:([^:]*):(.*)", ":::Module:%1:%2") output = output .. line .. "\n" end mw.addWarning(output) end

p.Documentation = { {		name = "warn", params = { {				name = "msg", description = "Warning message to log above the edit preview area", },			{				name = "level", description = "The number of additional call frames to skim off the top of the stack trace", }		},		returns = "Returns nil, but logs the above message along with a stack trace (of only the relevant call frames). Preview this page for an example of output." }, }

return p