Changeset

3758:900ea02ab00b

mod_log_json: Deregister log sink on unload Clean up after itself on unload. This also helps reinitialize the sink on reload.
author Kim Alvefur <zash@zash.se>
date Sat, 23 Nov 2019 04:53:16 +0100
parents 3757:971417eedfee
children 3759:57eb248f6dd3
files mod_log_json/mod_log_json.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_log_json/mod_log_json.lua	Sat Nov 23 04:52:43 2019 +0100
+++ b/mod_log_json/mod_log_json.lua	Sat Nov 23 04:53:16 2019 +0100
@@ -42,4 +42,9 @@
 	end
 end
 
+function module.unload()
+	-- deregister
+	require"core.loggingmanager".register_sink_type("json", nil);
+end
+
 require"core.loggingmanager".register_sink_type("json", sink_maker);