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
1 changed files with 5 additions and 2 deletions

View File

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