Skip to content

Commit b2926b4

Browse files
committed
Merge branch 'john/kernel/fix-logger-pretty-print-test' into maint
* john/kernel/fix-logger-pretty-print-test: logger: Ensure order for get_handler_config/0 and get_handler_ids/0
2 parents 8e4f567 + b27196b commit b2926b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/kernel/src/logger.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,16 +1100,17 @@ filter_config(#{module:=Module}=Config) ->
11001100
-spec get_handler_config() -> [Config] when
11011101
Config :: logger_handler:config().
11021102
get_handler_config() ->
1103-
Configs = logger_config:get(?LOGGER_TABLE),
1104-
[filter_config(Config) || Config <- Configs].
1103+
Configs0 = logger_config:get(?LOGGER_TABLE),
1104+
Configs = [filter_config(Config) || Config <- Configs0],
1105+
lists:sort(fun(#{ id := LHS }, #{ id := RHS }) -> LHS =< RHS end, Configs).
11051106

11061107
-doc "Look up the identities for all installed handlers.".
11071108
-doc(#{group => <<"Configuration API functions">>,since => <<"OTP 21.0">>}).
11081109
-spec get_handler_ids() -> [HandlerId] when
11091110
HandlerId :: logger_handler:id().
11101111
get_handler_ids() ->
11111112
{ok,#{handlers:=HandlerIds}} = logger_config:get(?LOGGER_TABLE,primary),
1112-
HandlerIds.
1113+
lists:sort(HandlerIds).
11131114

11141115
-doc """
11151116
Look up the current configuration for the Logger proxy.

0 commit comments

Comments
 (0)