Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 2 deletions.
  1. +1 −1 src/lager_console_backend.erl
  2. +5 −1 src/lager_file_backend.erl
View
2 src/lager_console_backend.erl
@@ -52,7 +52,7 @@ init([Level, Verbose]) ->
%% @private
handle_call(get_loglevel, #state{level=GenLevel, mod_levels = ModLvls} = State) ->
- Level = erlang:hd(lists:sort([GenLevel | [ ModLvl || {_, ModLvl} <- ModLvls ]])),
+ Level = erlang:tl(lists:sort([GenLevel | [ ModLvl || {_, ModLvl} <- ModLvls ]])),
{ok, Level, State};
handle_call({get_mod_loglevel, Module}, #state{mod_levels = ModLvls} = State) ->
case lists:keysearch(Module, 1, ModLvls) of
View
6 src/lager_file_backend.erl
@@ -95,8 +95,12 @@ 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 ]])),
+ Level = erlang:tl(lists:sort([GenLevel | [ ModLvl || {_, ModLvl} <- ModLvls ]])),
{ok, Level, State};
handle_call({get_mod_loglevel, Module}, #state{mod_levels = ModLvls} = State) ->
case lists:keysearch(Module, 1, ModLvls) of

No commit comments for this range

Something went wrong with that request. Please try again.