diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-10-03 18:21:09 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-10-03 18:21:09 +0100 |
commit | 0f46cd89fd093c6aa68a7332a229ed9e3e1ca58a (patch) | |
tree | 2bc3dffdaa03285390c33bc1090e10e11bdb537d | |
parent | cf0a3e56205c1c5a5436fdb62b64882b7a5c91e6 (diff) | |
download | rabbitmq-server-0f46cd89fd093c6aa68a7332a229ed9e3e1ca58a.tar.gz |
Don't print the list of enabled / disabled / missing plugins with ~p, it's not very readable.
-rw-r--r-- | src/rabbit_plugins.erl | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 47367402..0f6727a4 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -98,8 +98,8 @@ action(enable, ToEnable0, _Opts, PluginsFile, PluginsDir) -> Missing = ToEnable -- plugin_names(AllPlugins), case Missing of [] -> ok; - _ -> io:format("Warning: the following plugins could not be " - "found: ~p~n", [Missing]) + _ -> print_list("Warning: the following plugins could not be found:", + Missing) end, NewEnabled = lists:usort(Enabled ++ ToEnable), write_enabled_plugins(PluginsFile, NewEnabled), @@ -107,8 +107,8 @@ action(enable, ToEnable0, _Opts, PluginsFile, PluginsDir) -> [] -> io:format("Plugin configuration unchanged.~n"); _ -> NewImplicitlyEnabled = calculate_required_plugins(NewEnabled, AllPlugins), - io:format("The following plugins have been enabled: ~p~n", - [NewImplicitlyEnabled -- ImplicitlyEnabled]), + print_list("The following plugins have been enabled:", + NewImplicitlyEnabled -- ImplicitlyEnabled), io:format("Plugin configuration has changed. " "You should restart RabbitMQ.~n") end; @@ -124,8 +124,8 @@ action(disable, ToDisable0, _Opts, PluginsFile, PluginsDir) -> Missing = ToDisable -- plugin_names(AllPlugins), case Missing of [] -> ok; - _ -> io:format("Warning: the following plugins could not be " - "found: ~p~n", [Missing]) + _ -> print_list("Warning: the following plugins could not be found:", + Missing) end, ToDisable1 = ToDisable -- Missing, ToDisable2 = calculate_dependencies(true, ToDisable1, AllPlugins), @@ -136,8 +136,8 @@ action(disable, ToDisable0, _Opts, PluginsFile, PluginsDir) -> calculate_required_plugins(Enabled, AllPlugins), NewImplicitlyEnabled = calculate_required_plugins(NewEnabled, AllPlugins), - io:format("The following plugins have been disabled: ~p~n", - [ImplicitlyEnabled -- NewImplicitlyEnabled]), + print_list("The following plugins have been disabled:", + ImplicitlyEnabled -- NewImplicitlyEnabled), write_enabled_plugins(PluginsFile, NewEnabled), io:format("Plugin configuration has changed. " "You should restart RabbitMQ.~n") @@ -279,6 +279,11 @@ format_plugin(#plugin{name = Name, version = Version, io:format("~n") end. +print_list(Header, Plugins) -> + io:format("~s~n", [Header]), + [io:format(" ~s~n", [P]) || P <- Plugins], + io:format("~n"). + usort_plugins(Plugins) -> lists:usort(fun plugins_cmp/2, Plugins). |