瀏覽代碼

add flush options to proplist validation

pull/439/head
Ulf Wiger 7 年之前
父節點
當前提交
295d6031ed
共有 1 個檔案被更改,包括 14 行新增0 行删除
  1. +14
    -0
      src/lager_file_backend.erl

+ 14
- 0
src/lager_file_backend.erl 查看文件

@ -419,6 +419,20 @@ validate_logfile_proplist([{formatter_config, FmtCfg}|Tail], Acc) ->
false -> false ->
throw({bad_config, "Invalid formatter config", FmtCfg}) throw({bad_config, "Invalid formatter config", FmtCfg})
end; 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) -> validate_logfile_proplist([Other|_Tail], _Acc) ->
throw({bad_config, "Invalid option", Other}). throw({bad_config, "Invalid option", Other}).

Loading…
取消
儲存