Skip to content

Commit

Permalink
Remove duplicate keys from template
Browse files Browse the repository at this point in the history
  • Loading branch information
reachfh committed Dec 27, 2023
1 parent 7d8a139 commit 5c3d88c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/logger_formatter_json.erl
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ add_default_config(Config0) ->

expand_templates(Templates0) ->
Templates1 = lists:map(fun default_template/1, Templates0),
lists:flatten(Templates1).
Templates2 = remove_dups(Templates1),
lists:flatten(Templates2).


default_template({keys, all}) -> [msg, all];
Expand Down Expand Up @@ -630,3 +631,6 @@ check_timezone(Tz) ->
p(#{single_line := Single}) -> p(Single);
p(true) -> "~0tp";
p(false) -> "~tp".

remove_dups([]) -> [];
remove_dups([H | T]) -> [H | [X || X <- remove_dups(T), X /= H]].

0 comments on commit 5c3d88c

Please sign in to comment.