Diff

util/logger.lua @ 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
parent 615:4ae3e81513f3
child 758:b1885732e979
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