aboutsummaryrefslogtreecommitdiffstats
path: root/util/logger.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-01-14 23:04:16 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-01-14 23:04:16 +0500
commitdbab107f8ef2bbfa435496dac0d3a1a48a87afcb (patch)
tree7fdb035f6c87caf580bcb711ac493d9fd8f9a877 /util/logger.lua
parentbf2469eb7c5fbc117c77305420b7721723665e39 (diff)
downloadprosody-dbab107f8ef2bbfa435496dac0d3a1a48a87afcb.tar.gz
prosody-dbab107f8ef2bbfa435496dac0d3a1a48a87afcb.zip
util/logger: setwriter now returns the old writer on success
Diffstat (limited to 'util/logger.lua')
-rw-r--r--util/logger.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/logger.lua b/util/logger.lua
index 5115bbda..bbc783d4 100644
--- a/util/logger.lua
+++ b/util/logger.lua
@@ -63,10 +63,12 @@ function init(name)
end
function setwriter(f)
- if not f then outfunction = nil; return true, nil; end
+ local old_func = outfunction;
+ if not f then outfunction = nil; return true, old_func; end
local ok, ret = pcall(f, "logger", "info", "Switched logging output successfully");
if ok then
outfunction = f;
+ ret = old_func;
end
return ok, ret;
end