Changeset

12395:1e34b910b73a

util.logger: Return sink_function from add_simple_sink() This allows a simple sink to be later removed via remove_sink()
author Matthew Wild <mwild1@gmail.com>
date Thu, 17 Mar 2022 10:20:23 +0000
parents 12394:86d6b069b892
children 12396:bdb9577a4830
files util/logger.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/logger.lua	Thu Mar 17 10:19:35 2022 +0000
+++ b/util/logger.lua	Thu Mar 17 10:20:23 2022 +0000
@@ -79,6 +79,7 @@
 	for _, level in ipairs(levels or {"debug", "info", "warn", "error"}) do
 		add_level_sink(level, sink_function);
 	end
+	return sink_function;
 end
 
 local function remove_sink(sink_function)