# HG changeset patch # User Waqas Hussain # Date 1231956256 -18000 # Node ID d61eabc678a66f5c66d99f4c3aaa0aad1b9d1b72 # Parent beec1eb7d9c6761165a2af1500b43b4120db0c3e util/logger: setwriter now returns the old writer on success diff -r beec1eb7d9c6 -r d61eabc678a6 util/logger.lua --- a/util/logger.lua Wed Jan 14 22:35:01 2009 +0500 +++ b/util/logger.lua Wed Jan 14 23:04:16 2009 +0500 @@ -63,10 +63,12 @@ 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