John R. Daily 10 лет назад
Родитель
Сommit
52c753c4f8
2 измененных файлов: 9 добавлений и 5 удалений
  1. +1
    -0
      src/lager_app.erl
  2. +8
    -5
      src/lager_config.erl

+ 1
- 0
src/lager_app.erl Просмотреть файл

@ -118,6 +118,7 @@ wrap_proplist_value(Value) ->
{ok, Value}.
configure_sink(Sink, SinkDef) ->
lager_config:new_sink(Sink),
determine_async_behavior(Sink,
wrap_proplist_value(
proplists:get_value(async_threshold, SinkDef)),

+ 8
- 5
src/lager_config.erl Просмотреть файл

@ -20,7 +20,7 @@
-include("lager.hrl").
-export([new/0, get/1, get/2, set/2,
-export([new/0, new_sink/1, get/1, get/2, set/2,
global_get/1, global_get/2, global_set/2]).
-define(TBL, lager_config).
@ -40,14 +40,17 @@ new() ->
error:badarg ->
?INT_LOG(warning, "Table ~p already exists", [?TBL])
end,
%% use insert_new here so that if we're in an appup we don't mess anything up
%%
%% until lager is completely started, allow all messages to go through
ets:insert_new(?TBL, {{?DEFAULT_SINK, loglevel}, {element(2, lager_util:config_to_mask(debug)), []}}),
new_sink(?DEFAULT_SINK),
%% Need to be able to find the `lager_handler_watcher' for all handlers
ets:insert_new(?TBL, {{?GLOBAL, handlers}, []}),
ok.
new_sink(Sink) ->
%% use insert_new here so that if we're in an appup we don't mess anything up
%%
%% until lager is completely started, allow all messages to go through
ets:insert_new(?TBL, {{Sink, loglevel}, {element(2, lager_util:config_to_mask(debug)), []}}).
global_get(Key) ->
global_get(Key, undefined).

Загрузка…
Отмена
Сохранить