25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Avoid custom loglevels processing for lager

This commit is contained in:
Evgeniy Khramtsov 2013-06-27 19:27:20 +10:00
parent 597934637c
commit 8a9743ab3b

View File

@ -37,7 +37,7 @@
-spec get_log_path() -> string(). -spec get_log_path() -> string().
-spec reopen_log() -> ok. -spec reopen_log() -> ok.
-spec get() -> {loglevel(), atom(), string()}. -spec get() -> {loglevel(), atom(), string()}.
-spec set(loglevel()) -> {module, module()}. -spec set(loglevel() | {loglevel(), list()}) -> {module, module()}.
%%%=================================================================== %%%===================================================================
%%% API %%% API
@ -97,7 +97,7 @@ get() ->
debug -> {5, debug, "Debug"} debug -> {5, debug, "Debug"}
end. end.
set(LogLevel) -> set(LogLevel) when is_integer(LogLevel) ->
LagerLogLevel = case LogLevel of LagerLogLevel = case LogLevel of
0 -> none; 0 -> none;
1 -> critical; 1 -> critical;
@ -120,6 +120,9 @@ set(LogLevel) ->
ok ok
end, gen_event:which_handlers(lager_event)) end, gen_event:which_handlers(lager_event))
end, end,
{module, lager};
set({_LogLevel, _}) ->
error_logger:error_msg("custom loglevels are not supported for 'lager'"),
{module, lager}. {module, lager}.
-else. -else.