Diff

util/debug.lua @ 4519:510f4ba7080f

util.debug: Attempt to get debug.traceback() parameter handling correct (again)
author Matthew Wild <mwild1@gmail.com>
date Thu, 22 Mar 2012 15:07:27 +0000
parent 4465:41c4252526bd
child 4520:2d85ac26799c
line wrap: on
line diff
--- 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 "";