Skip to content

Commit

Permalink
Use proper format depending on the formatter (processone#4256)
Browse files Browse the repository at this point in the history
This fixes recent commmit 090a8e3
  • Loading branch information
badlop committed Jul 15, 2024
1 parent 69b77e7 commit 9b2760d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ejabberd_logger.erl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,16 @@ console_template() ->
andalso
'Elixir.System':version() >= <<"1.15">> of
true ->
[date, " ", time, " [", level, "] ", msg, "\n"];
{ok, DC} = logger:get_handler_config(default),
MessageFormat = case maps:get(formatter, DC) of
%% https://hexdocs.pm/logger/1.17.2/Logger.Formatter.html#module-formatting
{'Elixir.Logger.Formatter', _} ->
message;
%% https://www.erlang.org/doc/apps/kernel/logger_formatter#t:template/0
{logger_formatter, _} ->
msg
end,
[date, " ", time, " [", level, "] ", MessageFormat, "\n"];
false ->
[time, " [", level, "] " | msg()]
end.
Expand Down

0 comments on commit 9b2760d

Please sign in to comment.