# HG changeset patch # User Matthew Wild # Date 1332428847 0 # Node ID 510f4ba7080f1075daf3775d9cffa0d0149842c4 # Parent f2d695d2e31e694c568ec078abb5619ee58b3900 util.debug: Attempt to get debug.traceback() parameter handling correct (again) diff -r f2d695d2e31e -r 510f4ba7080f util/debug.lua --- a/util/debug.lua Fri Mar 09 18:46:19 2012 +0000 +++ b/util/debug.lua Thu Mar 22 15:07:27 2012 +0000 @@ -95,7 +95,11 @@ if level and type(message) ~= "string" then return nil, "invalid message"; elseif not level then - level = message or 2; + if type(message) == "number" then + level, message = message, nil; + else + level = 2; + end end message = message and (message.."\n") or "";