# HG changeset patch # User Kim Alvefur # Date 1522943631 -7200 # Node ID b773b15fee71cb35236d7e6d3c85e8aef93c144f # Parent dba17a70fd2204e84d092ea7f985b690a46d5998 util.startup: Set up event hooks for reloading logging here instead of in loggingmanager to simplify startup dependencies diff -r dba17a70fd22 -r b773b15fee71 core/loggingmanager.lua --- a/core/loggingmanager.lua Thu Apr 05 17:52:37 2018 +0200 +++ b/core/loggingmanager.lua Thu Apr 05 17:53:51 2018 +0200 @@ -18,7 +18,6 @@ local config = require "core.configmanager"; local logger = require "util.logger"; -local prosody = prosody; local _ENV = nil; -- luacheck: std none @@ -152,13 +151,8 @@ for name, sink_maker in pairs(old_sink_types) do log_sink_types[name] = sink_maker; end - - prosody.events.fire_event("logging-reloaded"); end -reload_logging(); -prosody.events.add_handler("reopen-log-files", reload_logging); - --- Definition of built-in logging sinks --- -- Null sink, must enter log_sink_types *first* diff -r dba17a70fd22 -r b773b15fee71 util/startup.lua --- 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()