mod_log_events/mod_log_events.lua
author Matthew Wild <mwild1@gmail.com>
Mon, 22 Aug 2022 13:28:01 +0100
changeset 5011 34fb3d239ac1
parent 1999 0e008f36a91c
permissions -rw-r--r--
*/README: Update compatibility info of modules still using legacy is_admin API mod_admin_message mod_admin_probe mod_block_outgoing mod_broadcast mod_data_access mod_muc_config_restrict mod_muc_restrict_rooms

module:set_global();

local helpers = require "util.helpers";

local function init(module, events, name)
	helpers.log_events(events, name, module._log);

	function module.unload()
		helpers.revert_log_events(events);
	end
end

init(module, prosody.events, "global");

function module.add_host(module)
	init(module, prosody.hosts[module.host].events, module.host);
end