code: public void anonymize() throws Exception {
      EventRecord er = null;
      SerializedRecord sr = null;
  
      BufferedWriter bfw = new BufferedWriter(new FileWriter(logfile.getName()
          + ".anonymized"));
  
      System.out.println("Anonymizing log records...");
      while ((er = parser.getNext()) != null) {
        if (er.isValid()) {
          sr = new SerializedRecord(er);
          Anonymizer.anonymize(sr);
          bfw.write(LocalStore.pack(sr).toString());
          bfw.write(LocalStore.RECORD_SEPARATOR);
        }
      }
      bfw.flush();
      bfw.close();
      System.out.println("Anonymized log records written to " + logfile.getName()
          + ".anonymized");
  
      System.out.println("Compressing output file...");
      LocalStore.zipCompress(logfile.getName() + ".anonymized");
      System.out.println("Compressed output file written to " + logfile.getName()
          + ".anonymized" + LocalStore.COMPRESSION_SUFFIX);
    }
docs: Performs anonymization for the log file. Log entries are
  read one by one and EventRecords are created, which are then
  anonymized and written to the output.