Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add clear_loglevel to file backend

  • Loading branch information...
commit 7f3e5f9bdb0f666469137d2b77c900f90e6be2b5 1 parent 392aa6c
@fenek authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/lager_file_backend.erl
View
4 src/lager_file_backend.erl
@@ -95,6 +95,10 @@ handle_call({set_loglevel, Level, Module}, #state{name = Ident, mod_levels = Mod
_ ->
{ok, {error, bad_log_level}, State}
end;
+handle_call({clear_loglevel, []}, State) ->
+ {ok, ok, State#state{ mod_levels = [] }};
+handle_call({clear_loglevel, Module}, #state{mod_levels = ModLvls} = State) ->
+ {ok, ok, State#state{ mod_levels = lists:keydelete(Module, 1, ModLvls) }};
handle_call(get_loglevel, #state{level=GenLevel, mod_levels = ModLvls} = State) ->
Level = erlang:hd(lists:sort([GenLevel | [ ModLvl || {_, ModLvl} <- ModLvls ]])),
{ok, Level, State};
Please sign in to comment.
Something went wrong with that request. Please try again.