Software /
code /
prosody
Comparison
util/logger.lua @ 53:14ea0fe6ca86
Session destruction fixes, some debugging code while we fix the rest. Also change logger to be more useful.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Oct 2008 15:25:54 +0100 |
parent | 30:bcf539295f2d |
child | 147:ccebb2720741 |
comparison
equal
deleted
inserted
replaced
52:93e468eb2ffb | 53:14ea0fe6ca86 |
---|---|
7 | 7 |
8 function init(name) | 8 function init(name) |
9 name = nil; -- While this line is not commented, will automatically fill in file/line number info | 9 name = nil; -- While this line is not commented, will automatically fill in file/line number info |
10 return function (level, message, ...) | 10 return function (level, message, ...) |
11 if not name then | 11 if not name then |
12 local inf = debug.getinfo(2, 'Snl'); | 12 local inf = debug.getinfo(3, 'Snl'); |
13 level = level .. ","..tostring(inf.short_src):match("[^/]*$")..":"..inf.currentline; | 13 level = level .. ","..tostring(inf.short_src):match("[^/]*$")..":"..inf.currentline; |
14 end | 14 end |
15 if ... then | 15 if ... then |
16 print(level, format(message, ...)); | 16 print(level, format(message, ...)); |
17 else | 17 else |