From dbab107f8ef2bbfa435496dac0d3a1a48a87afcb Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 14 Jan 2009 23:04:16 +0500 Subject: util/logger: setwriter now returns the old writer on success --- util/logger.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util/logger.lua') 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 -- cgit v1.2.3