Diff

util/startup.lua @ 8721:b773b15fee71

util.startup: Set up event hooks for reloading logging here instead of in loggingmanager to simplify startup dependencies
author Kim Alvefur <zash@zash.se>
date Thu, 05 Apr 2018 17:53:51 +0200
parent 8720:dba17a70fd22
child 8728:41c959c5c84b
line wrap: on
line diff
--- a/util/startup.lua	Thu Apr 05 17:52:37 2018 +0200
+++ b/util/startup.lua	Thu Apr 05 17:53:51 2018 +0200
@@ -84,7 +84,12 @@
 
 function startup.init_logging()
 	-- Initialize logging
-	require "core.loggingmanager"
+	local loggingmanager = require "core.loggingmanager"
+	loggingmanager.reload_logging();
+	prosody.events.add_handler("reopen-log-files", function ()
+		loggingmanager.reload_logging();
+		prosody.events.fire_event("logging-reloaded");
+	end);
 end
 
 function startup.log_dependency_warnings()