Procházet zdrojové kódy

Merge pull request #439 from aeternity/uw-flush-bugfix

add flush options to proplist validation
pull/440/head
Andrew Thompson před 7 roky
odevzdal GitHub
rodič
revize
ff134d4046
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. +14
    -0
      src/lager_file_backend.erl

+ 14
- 0
src/lager_file_backend.erl Zobrazit soubor

@ -419,6 +419,20 @@ validate_logfile_proplist([{formatter_config, FmtCfg}|Tail], Acc) ->
false ->
throw({bad_config, "Invalid formatter config", FmtCfg})
end;
validate_logfile_proplist([{flush_queue, FlushCfg}|Tail], Acc) ->
case is_boolean(FlushCfg) of
true ->
validate_logfile_proplist(Tail, [{flush_queue, FlushCfg}|Acc]);
false ->
throw({bad_config, "Invalid queue flush flag", FlushCfg})
end;
validate_logfile_proplist([{flush_queue_threshold, Thr}|Tail], Acc) ->
case Thr of
_ when is_integer(Thr), Thr >= 0 ->
validate_logfile_proplist(Tail, [{flush_queue_threshold, Thr}|Acc]);
_ ->
throw({bad_config, "Invalid queue flush threshold", Thr})
end;
validate_logfile_proplist([Other|_Tail], _Acc) ->
throw({bad_config, "Invalid option", Other}).

Načítá se…
Zrušit
Uložit