Skip to content
Browse files

Fix for loglevel none in status

  • Loading branch information...
1 parent 351e482 commit 24d17d05fa8ba004476d91d2b49a85c0414b27ab @Vagabond Vagabond committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/lager.erl
View
10 src/lager.erl
@@ -210,7 +210,10 @@ status() ->
[begin
LevelName = case Level of
{mask, Mask} ->
- hd(lager_util:mask_to_levels(Mask));
+ case lager_util:mask_to_levels(Mask) of
+ [] -> none;
+ Levels -> hd(Levels)
+ end;
Num ->
lager_util:num_to_level(Num)
end,
@@ -243,7 +246,10 @@ set_loglevel(Handler, Ident, Level) when is_atom(Level) ->
get_loglevel(Handler) ->
case gen_event:call(lager_event, Handler, get_loglevel, infinity) of
{mask, Mask} ->
- erlang:hd(lager_util:mask_to_levels(Mask));
+ case lager_util:mask_to_levels(Mask) of
+ [] -> none;
+ Levels -> hd(Levels)
+ end;
X when is_integer(X) ->
lager_util:num_to_level(X);
Y -> Y

0 comments on commit 24d17d0

Please sign in to comment.
Something went wrong with that request. Please try again.