Logging format improvement
authorWaqas Hussain <waqas20@gmail.com>
Fri, 13 Feb 2009 14:14:36 +0000 (19:14 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Fri, 13 Feb 2009 14:14:36 +0000 (19:14 +0500)
util/logger.lua

index d76e48f335a17b8fafee6ae94a519f8af4523a48..791e222b0f39a93fbeb53454362995421f8499b7 100644 (file)
@@ -33,16 +33,11 @@ local outfunction = nil;
 
 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