|
@ -48,10 +48,10 @@ start(Sink, Module, Config) -> |
|
|
gen_server:start(?MODULE, [Sink, Module, Config], []). |
|
|
gen_server:start(?MODULE, [Sink, Module, Config], []). |
|
|
|
|
|
|
|
|
init([Sink, Module, Config]) when is_list(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}}; |
|
|
{ok, #state{sink=Sink, module=Module, config=Config}}; |
|
|
init([Sink, Module, 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}}. |
|
|
{ok, #state{sink=Sink, module=Module, config=Config}}. |
|
|
|
|
|
|
|
|
handle_call(_Call, _From, State) -> |
|
|
handle_call(_Call, _From, State) -> |
|
@ -92,7 +92,7 @@ code_change(_OldVsn, State, _Extra) -> |
|
|
%% internal |
|
|
%% internal |
|
|
|
|
|
|
|
|
install_handler(Sink, Module, Config) -> |
|
|
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 -> |
|
|
ok -> |
|
|
?INT_LOG(debug, "Lager installed handler ~p into ~p", [Module, Sink]), |
|
|
?INT_LOG(debug, "Lager installed handler ~p into ~p", [Module, Sink]), |
|
|
lager:update_loglevel_config(Sink), |
|
|
lager:update_loglevel_config(Sink), |
|
|