Mercurial > prosody-modules
annotate mod_log_events/mod_log_events.lua @ 2609:6ab46ff685d0
mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
Daniel's business rules can be found here: https://mail.jabber.org/pipermail/standards/2016-February/030925.html
All implementation changes are documented in depth in the file business_rules.markdown
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Sat, 11 Mar 2017 01:42:45 +0100 |
parents | 0e008f36a91c |
children |
rev | line source |
---|---|
1638
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 module:set_global(); |
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 |
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 local helpers = require "util.helpers"; |
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 |
1995
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
5 local function init(module, events, name) |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
6 helpers.log_events(events, name, module._log); |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
7 |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
8 function module.unload() |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
9 helpers.revert_log_events(events); |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
10 end |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
11 end |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
12 |
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
13 init(module, prosody.events, "global"); |
1638
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 |
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 function module.add_host(module) |
1995
0e008f36a91c
mod_log_events: No such thing as module.remove_host. Fix this module so it can be loaded/unloaded dynamically and behave (mostly) correctly
Matthew Wild <mwild1@gmail.com>
parents:
1638
diff
changeset
|
16 init(module, prosody.hosts[module.host].events, module.host); |
1638
9276473ee5be
mod_log_events: Module to log all events on the server/host
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 end |