mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Log modules startup
This commit is contained in:
parent
85f09b365f
commit
c3c75affa9
@ -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().
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user