aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-02-13 22:10:29 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-02-13 22:10:29 +0500
commitb164423d1fa554646a2984494a377aadb2259d25 (patch)
treec7ae1cf886c612bd0c3c3c9cd82da856197d7284 /util
parent66155f71aa3d5ebf312b7b699984d0be08f2fdd1 (diff)
downloadprosody-b164423d1fa554646a2984494a377aadb2259d25.tar.gz
prosody-b164423d1fa554646a2984494a377aadb2259d25.zip
Logging format improvement
Diffstat (limited to 'util')
-rw-r--r--util/logger.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/util/logger.lua b/util/logger.lua
index d76e48f3..791e222b 100644
--- a/util/logger.lua
+++ b/util/logger.lua
@@ -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