From daf3fdeb02822aec5f79f3a40c31eb11ffd72380 Mon Sep 17 00:00:00 2001 From: "John R. Daily" Date: Mon, 27 Apr 2015 10:20:45 -0400 Subject: [PATCH] Move the extra sink argument down a layer so that reinstalls work properly --- src/lager_handler_watcher.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lager_handler_watcher.erl b/src/lager_handler_watcher.erl index 35daec9..6e8b739 100644 --- a/src/lager_handler_watcher.erl +++ b/src/lager_handler_watcher.erl @@ -48,10 +48,10 @@ start(Sink, Module, Config) -> gen_server:start(?MODULE, [Sink, Module, Config], []). init([Sink, Module, Config]) when is_list(Config) -> - install_handler(Sink, Module, [{sink, Sink}|Config]), + install_handler(Sink, Module, Config), {ok, #state{sink=Sink, module=Module, config=Config}}; init([Sink, Module, Config]) -> - install_handler(Sink, Module, [{sink, Sink}]++[Config]), + install_handler(Sink, Module, [Config]), {ok, #state{sink=Sink, module=Module, config=Config}}. handle_call(_Call, _From, State) -> @@ -92,7 +92,7 @@ code_change(_OldVsn, State, _Extra) -> %% internal install_handler(Sink, Module, Config) -> - case gen_event:add_sup_handler(Sink, Module, Config) of + case gen_event:add_sup_handler(Sink, Module, [{sink, Sink}|Config]) of ok -> ?INT_LOG(debug, "Lager installed handler ~p into ~p", [Module, Sink]), lager:update_loglevel_config(Sink),