Changeset

807:3ab6d7aec53f

Logging format improvement
author Waqas Hussain <waqas20@gmail.com>
date Fri, 13 Feb 2009 22:10:29 +0500
parents 797:6ea01e05b004
children 808:ce39abe0259a
files util/logger.lua
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/util/logger.lua	Fri Feb 13 16:43:44 2009 +0000
+++ b/util/logger.lua	Fri Feb 13 22:10:29 2009 +0500
@@ -33,16 +33,11 @@
 
 function init(name)
 	--name = nil; -- While this line is not commented, will automatically fill in file/line number info
-	sourcewidth = math_max(#name+2, sourcewidth);
 	local namelen = #name;
 	return 	function (level, message, ...)
-				if not name then
-					local inf = debug.getinfo(3, 'Snl');
-					level = level .. ","..tostring(inf.short_src):match("[^/]*$")..":"..inf.currentline;
-				end
-				
 				if outfunction then return outfunction(name, level, message, ...); end
 				
+				sourcewidth = math_max(#name+2, sourcewidth);
 				if ... then 
 					io_write(name, rep(" ", sourcewidth-namelen), getstring(logstyles[level], level), "\t", format(message, ...), "\n");
 				else