<commit_before>//
//  SystemLogCollector.swift
//  PinpointKit
//
//  Created by <NAME> on 2/5/16.
//  Copyright © 2016 Lickability. All rights reserved.
//

/**
 The type of logs to collect.
 
 - Application: Logs from the application target.
 - Testing:     Logs from the testing target.
 */
public enum ASLLoggingType {
    case Application
    case Testing
}

/// A log collector that uses [Apple System Logger](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/LoggingErrorsAndWarnings.html) API to retrieve messages logged to the console with `NSLog`.
public class SystemLogCollector: LogCollector {
    
    private let logger: ASLLogger
    
    public init(loggingType: ASLLoggingType = .Application) {
        switch loggingType {
        case .Application:
            logger = ASLLogger(bundleIdentifier: NSBundle.mainBundle().bundleIdentifier ?? "")
        case .Testing:
            logger = ASLLogger(senderName: "xctest")
        }
    }
    
    // MARK: - LogCollector<commit_msg>Made the enum a subtype<commit_after>//
//  SystemLogCollector.swift
//  PinpointKit
//
//  Created by <NAME> on 2/5/16.
//  Copyright © 2016 Lickability. All rights reserved.
//


/// A log collector that uses [Apple System Logger](https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/LoggingErrorsAndWarnings.html) API to retrieve messages logged to the console with `NSLog`.
public class SystemLogCollector: LogCollector {
    
    /**
     The type of logs to collect.
     */
    public enum LoggingType {
        /// Logs from the application target.
        case Application
        
        /// Logs from the testing target.
        case Testing
    }
    
    private let logger: ASLLogger
    
    public init(loggingType: LoggingType = .Application) {
        switch loggingType {
        case .Application:
            logger = ASLLogger(bundleIdentifier: NSBundle.mainBundle().bundleIdentifier ?? "")
        case .Testing:
            logger = ASLLogger(senderName: "xctest")
        }
    }
    
    // MARK: - LogCollector
{'fraction_non_alphanumeric': 0.09680451127819549, 'fraction_numerical': 0.007518796992481203, 'mean_word_length': 2.5542570951585977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6740078', 'n_tokens_mistral': 622, 'n_tokens_neox': 595, 'n_words': 169}