Module:UtilsError

local p = {}

function p.warn(msg, traceBack) if traceBack ~= false then local callStack = debug.traceback("", 2) msg = msg .. "\n\n" for line in string.gmatch(callStack, "\tModule:[^:]*:[^\n]*\n") do			line = string.gsub(line, "\tModule:([^:]*):(.*)", ":::Module:%1:%2") msg = msg .. line .. "\n" end end mw.addWarning(msg) end

p.Documentation = { {		name = "warn", params = { {				name = "msg", description = "Warning message to log above the edit preview area", },			{				name = "traceBack", description = "A boolean. If true or nil, prints a stack trace of all module frames.", }		},		returns = "Returns nil, but logs the above message, possibly with a stack trace. Preview this page for an example of output.", cases = { {				args = { "I AM ERROR" }, },			{				args = { "I AM ERROR", false }, }		},	}, }

return p