diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-01-14 23:04:16 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-01-14 23:04:16 +0500 |
commit | dbab107f8ef2bbfa435496dac0d3a1a48a87afcb (patch) | |
tree | 7fdb035f6c87caf580bcb711ac493d9fd8f9a877 /util | |
parent | bf2469eb7c5fbc117c77305420b7721723665e39 (diff) | |
download | prosody-dbab107f8ef2bbfa435496dac0d3a1a48a87afcb.tar.gz prosody-dbab107f8ef2bbfa435496dac0d3a1a48a87afcb.zip |
util/logger: setwriter now returns the old writer on success
Diffstat (limited to 'util')
-rw-r--r-- | util/logger.lua | 4 |
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 |