Skip to content

Commit

Permalink
Logging: Use : as the separator in verbosity mapping
Browse files Browse the repository at this point in the history
This is the same separator as the field mapping. I don't remember why I
picked a different character... Now, it feels awkward and non-intuitive
for users.

(cherry picked from commit 47e0a5f)
  • Loading branch information
dumbbell authored and mergify-bot committed Aug 10, 2021
1 parent bc91083 commit d5db735
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,19 +470,19 @@ parse_json_field_mapping([], Mapping) ->
%% @doc
%% Parses the verbosity_map pattern.
%%
%% The pattern is of the form: `debug=2 info=1 *=0'.
%% The pattern is of the form: `debug:2 info:1 *:0'.
%%
%% `debug=2' means that the verbosity of the debug level is 2.
%% `debug:2' means that the verbosity of the debug level is 2.
%%
%% `*=0' means that the verbosity of all non-mentionned levels is 0.
%% `*:0' means that the verbosity of all non-mentionned levels is 0.

parse_json_verbosity_mapping("") ->
#{};
parse_json_verbosity_mapping(RawMapping) ->
parse_json_verbosity_mapping(string:split(RawMapping, " ", all), #{}).

parse_json_verbosity_mapping([Entry | Rest], Mapping) ->
Mapping1 = case string:split(Entry, "=", leading) of
Mapping1 = case string:split(Entry, ":", leading) of
["*", VerbS] ->
Verb = list_to_integer(VerbS),
Mapping#{'$REST' => Verb};
Expand Down

0 comments on commit d5db735

Please sign in to comment.