anchor.diff:  -include("ale.hrl").
   
   -record(state, {
  -          path :: string(),
  -          file :: undefined | file:io_device(),
  -          file_size :: integer(),
  -          file_inode :: integer(),
             buffer :: binary(),
             buffer_size :: integer(),
             flush_timer :: undefined | reference(),
  +          worker :: pid(),
   
             batch_size :: pos_integer(),
  -          batch_timeout :: pos_integer(),
  +          batch_timeout :: pos_integer()
  +         }).
  +
  +-record(worker_state, {
  +          path :: string(),
  +          file :: file:io_device(),
  +          file_size :: integer(),
  +          file_inode :: integer(),
  +
             rotation_size :: non_neg_integer(),
             rotation_num_files :: pos_integer(),
             rotation_compress :: boolean(),
  
positive.code:     RotCompress = proplists:get_value(compress, RotationConf, true),
      RotCheckInterval = proplists:get_value(check_interval, RotationConf, 10000),
  
      State = #state{path = Path,
                     buffer = <<>>,
                     buffer_size = 0,
                     batch_size = BatchSize,
                     batch_timeout = BatchTimeout,
                     rotation_size = RotSize,
                     rotation_num_files = RotNumFiles,
                     rotation_compress = RotCompress,
                     rotation_check_interval = RotCheckInterval},
  
      case RotCheckInterval > 0 of
          true ->
              erlang:send_after(RotCheckInterval, self(), check_file);
          false ->
              ok
      end,
  
      {ok, open_log_file(State)}.
  
  handle_call({log, Msg}, _From, State) ->
      {reply, ok, log_msg(Msg, State)};
  handle_call(sync, _From, State) ->
      {reply, ok, sync(State)};
  handle_call(Request, _From, State) ->
      {stop, {unexpected_call, Request}, State}.
  
  
negative.code: maybe_rotate_files(State) ->
      State.
  
  open_log_file(#worker_state{path = Path,
                              file = OldFile} = State) ->
      case OldFile of
          undefined ->
              ok;
  