projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f8f5a6
)
util/logger: setwriter now returns the old writer on success
author
Waqas Hussain
<waqas20@gmail.com>
Wed, 14 Jan 2009 18:04:16 +0000
(23:04 +0500)
committer
Waqas Hussain
<waqas20@gmail.com>
Wed, 14 Jan 2009 18:04:16 +0000
(23:04 +0500)
util/logger.lua
patch
|
blob
|
history
diff --git
a/util/logger.lua
b/util/logger.lua
index 5115bbdaaeadc545fe2b2ef0a93b4e205911e721..bbc783d497e09b2ea48bb16c326146e861a87a91 100644
(file)
--- 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