Skip to content

Commit

Permalink
recurse into maps
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekgorny committed Aug 21, 2018
1 parent 6973be4 commit 01c10ec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/recon_trace.erl
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,17 @@ format_trace_output(true, Args) when is_list(Args) ->
L = lists:map(fun(A) -> format_trace_output(true, A) end, Args),
"[" ++ string:join(L, ", ") ++ "]"
end;
format_trace_output(true, Args) when is_map(Args) ->
ItemList = maps:to_list(Args),
["#{",
lists:join(", ", [format_kv(Key, Val) || {Key, Val} <- ItemList]),
"}"];
format_trace_output(_, Args) ->
io_lib:format("~p", [Args]).

format_kv(Key, Val) ->
[format_trace_output(true, Key), "=", format_trace_output(true, Val)].

%%%%%%%%%%%%%%%
%%% HELPERS %%%
%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 01c10ec

Please sign in to comment.