Diff

util/helpers.lua @ 5415:9e7aa5b47bdf

util.helpers: Helper helpers to log host events
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Apr 2013 13:39:00 +0100
parent 4705:447f5a94792d
child 5776:bd0ff8ae98a8
line wrap: on
line diff
--- a/util/helpers.lua	Wed Apr 03 13:38:27 2013 +0100
+++ b/util/helpers.lua	Wed Apr 03 13:39:00 2013 +0100
@@ -14,6 +14,14 @@
 
 local log = require "util.logger".init("util.debug");
 
+function log_host_events(host)
+	return log_events(prosody.hosts[host].events, host);
+end
+
+function revert_log_host_events(host)
+	return revert_log_events(prosody.hosts[host].events);
+end
+
 function log_events(events, name, logger)
 	local f = events.fire_event;
 	if not f then