Sfoglia il codice sorgente

Rework filters into composable named functions

pull/411/head
Andrew Thompson 8 anni fa
parent
commit
4791c529e6
1 ha cambiato i file con 18 aggiunte e 20 eliminazioni
  1. +18
    -20
      src/error_logger_lager_h.erl

+ 18
- 20
src/error_logger_lager_h.erl Vedi File

@ -88,30 +88,28 @@ shaper_fun() ->
{false, false} ->
fun(_) -> false end;
{true, true} ->
fun({info_report, _GL, {_Pid, std_info, D}}) when is_list(D) ->
lists:member({exited, stopped}, D);
({info_report, _GL, {_P, progress, D}}) ->
(lists:keymember(application, 1, D) andalso lists:keymember(started_at, 1, D)) orelse
(lists:keymember(started, 1, D) andalso lists:keymember(supervisor, 1, D));
(_) ->
false
end;
fun suppress_supervisor_start_and_application_start/1;
{false, true} ->
fun({info_report, _GL, {_Pid, std_info, D}}) when is_list(D) ->
lists:member({exited, stopped}, D);
({info_report, _GL, {_P, progress, D}}) ->
lists:keymember(application, 1, D) andalso lists:keymember(started_at, 1, D);
(_) ->
false
end;
fun suppress_application_start/1;
{true, false} ->
fun({info_report, _GL, {_P, progress, D}}) ->
lists:keymember(started, 1, D) andalso lists:keymember(supervisor, 1, D);
(_) ->
false
end
fun suppress_supervisor_start/1
end.
suppress_supervisor_start_and_application_start(E) ->
suppress_supervisor_start(E) orelse suppress_application_start(E).
suppress_application_start({info_report, _GL, {_Pid, std_info, D}}) when is_list(D) ->
lists:member({exited, stopped}, D);
suppress_application_start({info_report, _GL, {_P, progress, D}}) ->
lists:keymember(application, 1, D) andalso lists:keymember(started_at, 1, D);
suppress_application_start(_) ->
false.
suppress_supervisor_start({info_report, _GL, {_P, progress, D}}) ->
lists:keymember(started, 1, D) andalso lists:keymember(supervisor, 1, D);
suppress_supervisor_start(_) ->
false.
handle_event(Event, #state{sink=Sink, shaper=Shaper} = State) ->
case lager_util:check_hwm(Shaper, Event) of
{true, 0, NewShaper} ->

Caricamento…
Annulla
Salva