mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Use proper format depending on the formatter (#4256)
This fixes recent commmit 090a8e3
This commit is contained in:
parent
c013a59d16
commit
9bd6b11007
1 changed files with 10 additions and 1 deletions
|
@ -370,7 +370,16 @@ console_template() ->
|
||||||
andalso
|
andalso
|
||||||
'Elixir.System':version() >= <<"1.15">> of
|
'Elixir.System':version() >= <<"1.15">> of
|
||||||
true ->
|
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 ->
|
false ->
|
||||||
[time, " [", level, "] " | msg()]
|
[time, " [", level, "] " | msg()]
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue