<commit_before>//
//  Base64LogFormatter.swift
//  XCGLogger: https://github.com/DaveWoodCom/XCGLogger
//
//  Created by <NAME> on 2016-08-30.
//  Copyright © 2016 <NAME>, <NAME>.
//  Some rights reserved: https://github.com/DaveWoodCom/XCGLogger/blob/master/LICENSE.txt
//

// MARK: - Base64LogFormatter
/// An example log formatter to show how encryption could be used to secure log messages, in this case, we just Base64 encode them
open class Base64LogFormatter: LogFormatterProtocol, CustomDebugStringConvertible {

    // MARK: - LogFormatterProtocol
    /// Apply some additional formatting to the message if appropriate.
    ///
    /// - Parameters:
    ///     - logDetails:   The log details.
    ///     - message:      Formatted/processed message ready for output.
    ///
    /// - Returns:  message with the additional formatting
    ///
    @discardableResult open func format(logDetails: inout LogDetails, message: inout String) -> String {
        guard let utf8Message = message.data(using: .utf8) else { return message }

        message = utf8Message.base64EncodedString()
        return message
    }

    // MARK: - CustomDebugStringConvertible
    open var debugDescription: String {
        get {
            return "\(extractTypeName(self))"
        }
    }
}<commit_msg>Add public init to the example Base64LogFormatter class<commit_after>//
//  Base64LogFormatter.swift
//  XCGLogger: https://github.com/DaveWoodCom/XCGLogger
//
//  Created by <NAME> on 2016-08-30.
//  Copyright © 2016 <NAME>, <NAME>.
//  Some rights reserved: https://github.com/DaveWoodCom/XCGLogger/blob/master/LICENSE.txt
//

// MARK: - Base64LogFormatter
/// An example log formatter to show how encryption could be used to secure log messages, in this case, we just Base64 encode them
open class Base64LogFormatter: LogFormatterProtocol, CustomDebugStringConvertible {

    // MARK: - LogFormatterProtocol
    /// Apply some additional formatting to the message if appropriate.
    ///
    /// - Parameters:
    ///     - logDetails:   The log details.
    ///     - message:      Formatted/processed message ready for output.
    ///
    /// - Returns:  message with the additional formatting
    ///
    @discardableResult open func format(logDetails: inout LogDetails, message: inout String) -> String {
        guard let utf8Message = message.data(using: .utf8) else { return message }

        message = utf8Message.base64EncodedString()
        return message
    }

    /// Initializer, doesn't do anything other than make the class publicly available
    public init() {
    }

    // MARK: - CustomDebugStringConvertible
    open var debugDescription: String {
        get {
            return "\(extractTypeName(self))"
        }
    }
}
{'fraction_non_alphanumeric': 0.10585667515460168, 'fraction_numerical': 0.018915969443433975, 'mean_word_length': 2.599476439790576, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '1458757', 'n_tokens_mistral': 796, 'n_tokens_neox': 745, 'n_words': 234}