From b594f3b843e1d25fa163256594f0936eb511e1aa Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 5 Apr 2018 17:53:51 +0200 Subject: util.startup: Set up event hooks for reloading logging here instead of in loggingmanager to simplify startup dependencies --- util/startup.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/startup.lua b/util/startup.lua index 0d7cb08a..0b62249b 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -84,7 +84,12 @@ end 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() -- cgit v1.2.3