anchor.diff:  
       case file:open(Filename, [append]) of
       {ok, Fd} ->
  -        {ok, {Fd, Level, Sasl}};
  +        {ok, EolRe} = re:compile("\\r\\n|\\r|\\n"),
  +        {ok, #state{fd = Fd, level = Level, sasl = Sasl, eol_re = EolRe}};
       {error, eacces} ->
           {stop, {file_permission_error, Filename}};
       Error ->
  
positive.code:     % TODO: make streaming
  
      {ok, Chunk} = file:pread(Fd, Start, LogFileSize),
      Chunk.
  
negative.code: set_level_integer(Int) ->
      gen_event:call(error_logger, couch_log, {set_level_integer, Int}).
  
  handle_event({Pid, couch_error, {Format, Args}}, State) ->
      log(State, Pid, error, Format, Args),
      {ok, State};
  handle_event({Pid, couch_info, {Format, Args}}, #state{level = LogLevel} = St)
  when LogLevel =< ?LEVEL_INFO ->
      log(St, Pid, info, Format, Args),
      {ok, St};
  handle_event({Pid, couch_debug, {Format, Args}}, #state{level = LogLevel} = St)
  when LogLevel =< ?LEVEL_DEBUG ->
      log(St, Pid, debug, Format, Args),
      {ok, St};
  handle_event({error_report, _, {Pid, _, _}}=Event, #state{sasl = true} = St) ->
      log(St, Pid, error, "~p", [Event]),
      {ok, St};
  handle_event({error, _, {Pid, Format, Args}}, #state{sasl = true} = State) ->
      log(State, Pid, error, Format, Args),
      {ok, State};
  handle_event(_Event, State) ->
      {ok, State}.
  
  handle_call({set_level_integer, NewLevel}, State) ->
      ets:insert(?MODULE, {level, NewLevel}),
      {ok, ok, State#state{level = NewLevel}}.
  
  handle_info(_Info, State) ->
      {ok, State}.
  