25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Elixir: Fix: FORMATTER ERROR: bad return value (4087)

This is required since Elixir 1.15 when starting ejabberd with:
  ./configure --with-rebar=mix
  make relive
  make relive && ejabberdctl iexlive
  make install && ejabberdctl iexlive

Reference:
  https://elixir-lang.org/blog/2023/06/19/elixir-v1-15-0-released/
  https://hexdocs.pm/logger/Logger.Formatter.html#module-formatting
This commit is contained in:
Badlop 2023-12-19 20:21:19 +01:00
parent 5bb2beb179
commit 1bf80e861d

View File

@ -340,8 +340,20 @@ progress_filter(#{level:=info,msg:={report,#{label:={_,progress}}}} = Event, _)
progress_filter(Event, _) ->
Event.
-ifdef(ELIXIR_ENABLED).
console_template() ->
case (false /= code:is_loaded('Elixir.Logger'))
andalso
lists:keymember(default_formatter, 1, 'Elixir.Logger':module_info(exports)) of
true ->
[date, " ", time, " [", level, "] ", message, "\n"];
false ->
[time, " [", level, "] " | msg()]
end.
-else.
console_template() ->
[time, " [", level, "] " | msg()].
-endif.
file_template() ->
[time, " [", level, "] ", pid,