diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-06-14 10:18:10 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-06-14 10:18:10 +0300 |
commit | c3c75affa9a23f2395b9889efe8087abc1ac0556 (patch) | |
tree | ba1c305170de10293a7cfe85357bfc41d21b2f05 | |
parent | mod_push: Omit summary for outgoing messages (diff) |
Log modules startup
-rw-r--r-- | src/gen_mod.erl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gen_mod.erl b/src/gen_mod.erl index a30cc5462..878ac41ec 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -127,10 +127,9 @@ stop_child(Proc) -> %% Start all the modules in all the hosts start_modules() -> - lists:foreach( - fun(Host) -> - start_modules(Host) - end, ?MYHOSTS). + Hosts = ?MYHOSTS, + ?INFO_MSG("Loading modules for ~s", [format_hosts_list(Hosts)]), + lists:foreach(fun start_modules/1, Hosts). get_modules_options(Host) -> sort_modules(Host, ejabberd_config:get_option({modules, Host}, [])). @@ -745,6 +744,16 @@ format_module_error(Module, Fun, Arity, Opts, Class, Reason, St) -> [Module, Fun, Opts, Class, Reason, St]) end. +format_hosts_list([Host]) -> + Host; +format_hosts_list([H1, H2]) -> + [H1, " and ", H2]; +format_hosts_list([H1, H2, H3]) -> + [H1, ", ", H2, " and ", H3]; +format_hosts_list([H1, H2|Hs]) -> + io_lib:format("~s, ~s and ~B more hosts", + [H1, H2, length(Hs)]). + -spec db_type(binary() | global, module()) -> db_type(); (opts(), module()) -> db_type(). |