Переглянути джерело

Move the extra sink argument down a layer so that reinstalls work properly

pull/264/head
John R. Daily 10 роки тому
джерело
коміт
daf3fdeb02
1 змінених файлів з 3 додано та 3 видалено
  1. +3
    -3
      src/lager_handler_watcher.erl

+ 3
- 3
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),

Завантаження…
Відмінити
Зберегти