diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-02 15:25:42 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-02 15:25:42 +0100 |
commit | 8dada8a4ccb33e7a36ac3c1592379ae4ac904df4 (patch) | |
tree | 2d00c91fcf064c4d3579d4b74c1b4d5d62c65ba8 /src | |
parent | 226fdb07e5d8194bf23b67fc5f341a86f5250476 (diff) | |
download | rabbitmq-server-8dada8a4ccb33e7a36ac3c1592379ae4ac904df4.tar.gz |
Reduce diff from bug23554: Allow formatting of nested info items
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_control.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 8172f804..8e0a2a53 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -372,6 +372,12 @@ format_info_item([{TableEntryKey, TableEntryType, _TableEntryValue} | _] = Value) when is_binary(TableEntryKey) andalso is_atom(TableEntryType) -> io_lib:format("~1000000000000p", [prettify_amqp_table(Value)]); +format_info_item([T | _] = Value) + when is_tuple(T) orelse is_pid(T) orelse is_binary(T) orelse is_atom(T) orelse + is_list(T) -> + "[" ++ + lists:nthtail(2, lists:append( + [", " ++ format_info_item(E) || E <- Value])) ++ "]"; format_info_item(Value) -> io_lib:format("~w", [Value]). |