mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Determine the default handlerid at runtime
Apparently Elixir's default is not called 'default'
This commit is contained in:
parent
5b0a28bbc9
commit
fdfd202a30
@ -288,10 +288,11 @@ start(Level) ->
|
||||
ConsoleFmtConfig = FmtConfig#{template => console_template()},
|
||||
try
|
||||
ok = logger:set_primary_config(level, Level),
|
||||
ok = logger:update_formatter_config(default, ConsoleFmtConfig),
|
||||
DefaultHandlerId = get_default_handlerid(),
|
||||
ok = logger:update_formatter_config(DefaultHandlerId, ConsoleFmtConfig),
|
||||
case quiet_mode() of
|
||||
true ->
|
||||
ok = logger:set_handler_config(default, level, critical);
|
||||
ok = logger:set_handler_config(DefaultHandlerId, level, critical);
|
||||
_ ->
|
||||
ok
|
||||
end,
|
||||
@ -319,6 +320,13 @@ start(Level) ->
|
||||
Err
|
||||
end.
|
||||
|
||||
get_default_handlerid() ->
|
||||
Ids = logger:get_handler_ids(),
|
||||
case lists:member(default, Ids) of
|
||||
true -> default;
|
||||
false -> hd(Ids)
|
||||
end.
|
||||
|
||||
-spec restart() -> ok.
|
||||
restart() ->
|
||||
ok.
|
||||
|
Loading…
Reference in New Issue
Block a user