Changeset

716:d61eabc678a6

util/logger: setwriter now returns the old writer on success
author Waqas Hussain <waqas20@gmail.com>
date Wed, 14 Jan 2009 23:04:16 +0500
parents 715:beec1eb7d9c6
children 717:ab428c579cbc
files util/logger.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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