소스 검색

Merge pull request #436 from erlang-lager/adt/fix-flushing

Make a few corrections to the recent mailbox flushing changes
pull/439/head
Mark Allen 7 년 전
committed by GitHub
부모
커밋
c694de05f7
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -1
      src/error_logger_lager_h.erl
  2. +4
    -2
      src/lager_util.erl

+ 1
- 1
src/error_logger_lager_h.erl 파일 보기

@ -72,7 +72,7 @@ set_high_water(N) ->
-spec init(any()) -> {ok, #state{}}.
init([HighWaterMark, GlStrategy]) ->
Flush = application:get_env(lager, error_logger_flush_queue, false),
Flush = application:get_env(lager, error_logger_flush_queue, true),
FlushThr = application:get_env(lager, error_logger_flush_threshold, 0),
Shaper = #lager_shaper{hwm=HighWaterMark, flush_queue = Flush, flush_threshold = FlushThr, filter=shaper_fun(), id=?MODULE},
Raw = application:get_env(lager, error_logger_format_raw, false),

+ 4
- 2
src/lager_util.erl 파일 보기

@ -515,7 +515,7 @@ check_hwm(Shaper = #lager_shaper{lasttime = Last, dropped = Drop}) ->
true ->
discard_messages(Now, Shaper#lager_shaper.filter, 0);
false ->
1
0
end,
Timer = case erlang:read_timer(Shaper#lager_shaper.timer) of
false ->
@ -534,7 +534,9 @@ should_flush(#lager_shaper{flush_queue = true, flush_threshold = 0}) ->
true;
should_flush(#lager_shaper{flush_queue = true, flush_threshold = T}) ->
{_, L} = process_info(self(), message_queue_len),
L > T.
L > T;
should_flush(_) ->
false.
discard_messages(Second, Filter, Count) ->
{M, S, _} = os:timestamp(),

불러오는 중...
취소
저장