<commit_before>import Foundation

func publicHeaderDumpAllTestFrameworks(rootURL: NSURL, outputDirectoryURL: NSURL, logger: Logger) {
  let fileManager = NSFileManager.defaultManager()

  rootURL.enumerateTestingFrameworkHeaderDirectoryURLs { testingFrameworkHeaderDirectoryURL in
    let destinationURL = testingFrameworkHeaderDirectoryURL.publicHeaderDumpOutputURL(outputDirectoryURL)
    do {
      try fileManager.createDirectoryAtURL(
        destinationURL,
        withIntermediateDirectories: true,
        attributes: nil
      )
    } catch {
      logger.error("Could not create directory at \(destinationURL.absoluteString)")
      abort()
    }

    let sourceURLs: [NSURL]
    do {
      sourceURLs = try fileManager.contentsOfDirectoryAtURL(
        testingFrameworkHeaderDirectoryURL,
        includingPropertiesForKeys: [NSURLIsRegularFileKey],
        options: NSDirectoryEnumerationOptions.SkipsSubdirectoryDescendants)
    } catch {
      logger.error("Could not access contents of directory at \(testingFrameworkHeaderDirectoryURL.absoluteString)")
      abort()
    }

    for sourceURL in sourceURLs {
      do {
        try fileManager.copyItemAtURL(
          sourceURL,
          toURL: destinationURL.URLByAppendingPathComponent(sourceURL.lastPathComponent!)
        )
      } catch {
        logger.error("Could not copy source URL \(sourceURL.absoluteString) to destination URL \(destinationURL.absoluteString)")
      }
    }
  }
}<commit_msg>Add logging to header dump<commit_after>import Foundation

func publicHeaderDumpAllTestFrameworks(rootURL: NSURL, outputDirectoryURL: NSURL, logger: Logger) {
  let fileManager = NSFileManager.defaultManager()

  rootURL.enumerateTestingFrameworkHeaderDirectoryURLs { testingFrameworkHeaderDirectoryURL in
    let destinationURL = testingFrameworkHeaderDirectoryURL.publicHeaderDumpOutputURL(outputDirectoryURL)
    do {
      try fileManager.createDirectoryAtURL(
        destinationURL,
        withIntermediateDirectories: true,
        attributes: nil
      )
    } catch {
      logger.error("Could not create directory at \(destinationURL.absoluteString)")
      abort()
    }

    let sourceURLs: [NSURL]
    do {
      sourceURLs = try fileManager.contentsOfDirectoryAtURL(
        testingFrameworkHeaderDirectoryURL,
        includingPropertiesForKeys: [NSURLIsRegularFileKey],
        options: NSDirectoryEnumerationOptions.SkipsSubdirectoryDescendants)
    } catch {
      logger.error("Could not access contents of directory at \(testingFrameworkHeaderDirectoryURL.absoluteString)")
      abort()
    }

    for sourceURL in sourceURLs {
      do {
        let toURL = destinationURL.URLByAppendingPathComponent(sourceURL.lastPathComponent!)
        logger.info("\(sourceURL.absoluteString) => \(toURL.absoluteString)")
        try fileManager.copyItemAtURL(sourceURL, toURL: toURL)
      } catch {
        logger.error("Could not copy source URL \(sourceURL.absoluteString) to destination URL \(destinationURL.absoluteString)")
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.07319485657764589, 'fraction_numerical': 0.0, 'mean_word_length': 3.7038759689922482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3843520', 'n_tokens_mistral': 785, 'n_tokens_neox': 777, 'n_words': 162}