anchor.diff:                     batch_size = BatchSize,
                      batch_timeout = BatchTimeout,
                      rotation_size = RotSize,
  -                   rotation_num_files = RotNumFiles},
  +                   rotation_num_files = RotNumFiles,
  +                   rotation_compress = RotCompress},
   
       {ok, open_log_file(State)}.
   
  
positive.code:           batch_size :: pos_integer(),
            batch_timeout :: pos_integer(),
            rotation_size :: non_neg_integer(),
            rotation_num_files :: pos_integer()
           }).
  
  start_link(Name, Path) ->
  
negative.code:         Error ->
              Error
      end.
  
  maybe_compress_post_rotate(#state{path = Path,
                                    rotation_num_files = NumFiles,
                                    rotation_compress = true})
    when NumFiles > 1 ->
      UncompressedPath = Path ++ ".1",
      CompressedPath = Path ++ ".1.gz",
      compress_file(UncompressedPath, CompressedPath);
  maybe_compress_post_rotate(_) ->
      ok.
  
  compress_file(FromPath, ToPath) ->
      {ok, From} = file:open(FromPath, [raw, binary, read]),
  
      try
          {ok, To} = file:open(ToPath, [raw, binary, write]),
          Z = zlib:open(),
  
          try
              ok = zlib:deflateInit(Z, default, deflated, 15 + 16, 8, default),
              compress_file_loop(From, To, Z),
              ok = zlib:deflateEnd(Z),
              ok = file:delete(FromPath)
          after
              file:close(To),
              zlib:close(Z)
          end
      after
          file:close(From)
      end.
  
  compress_file_loop(From, To, Z) ->
      {Compressed, Continue} =
          case file:read(From, 1024 * 1024) of
              eof ->
                  {zlib:deflate(Z, <<>>, finish), false};
              {ok, Data} ->
                  {zlib:deflate(Z, Data), true}
          end,
  
      case iolist_to_binary(Compressed) of
          <<>> ->
              ok;
          CompressedBinary ->
              ok = file:write(To, CompressedBinary)
      end,
  
      case Continue of
          true ->
              compress_file_loop(From, To, Z);
          false ->
              ok
      end.
  