diff --git a/src/lager.erl b/src/lager.erl index f617b0a..068456e 100644 --- a/src/lager.erl +++ b/src/lager.erl @@ -210,7 +210,16 @@ stop_trace(Backend, Filter, Level) -> stop_trace({Backend, Filter, Level}) -> stop_trace(Backend, Filter, Level). -stop_trace_int({Backend, _Filter, _Level} = Trace) -> +%% Important: validate_trace_filters orders the arguments of +%% trace tuples differently than the way outside callers have +%% the trace tuple. +%% +%% That is to say, outside they are represented as +%% `{Backend, Filter, Level}' +%% +%% and when they come back from validation, they're +%% `{Filter, Level, Backend}' +stop_trace_int({_Filter, _Level, Backend} = Trace) -> {Level, Traces} = lager_config:get(loglevel), NewTraces = lists:delete(Trace, Traces), _ = lager_util:trace_filter([ element(1, T) || T <- NewTraces ]),