<commit_before>"""
Simple logging class


Released under the MIT license
Copyright (c) 2012, <NAME>

@category   misc
@version    $Id: 1.6, 2014-07-21 18:48:00 CST $;
@author     <NAME> <<EMAIL>>
@license    http://opensource.org/licenses/MIT
"""

import logging
import sys


class logger(object):

    def __init__(self, name, debug):
        frmt = logging.Formatter(
            '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
            "%Y-%m-%d %H:%M:%S"
        )

        if debug:
            logLevel = logging.DEBUG
        else:
            logLevel = logging.INFO

        self.sh = logging.StreamHandler(sys.stdout)
        self.sh.setLevel(logLevel)
        self.sh.setFormatter(frmt)

        self.fh = logging.FileHandler('autoripper.log')
        self.fh.setLevel(logLevel)
        self.fh.setFormatter(frmt)

        self.log = logging.getLogger(name)
        self.log.setLevel(logLevel)
        self.log.addHandler(self.sh)
        self.log.addHandler(self.fh)

    def __del__(self):
        self.log.removeHandler(self.sh)<commit_msg>file name change<commit_after>"""
Simple logging class


Released under the MIT license
Copyright (c) 2012, <NAME>

@category   misc
@version    $Id: 1.6, 2014-07-21 18:48:00 CST $;
@author     <NAME> <<EMAIL>>
@license    http://opensource.org/licenses/MIT
"""

import logging
import sys


class logger(object):

    def __init__(self, name, debug):
        frmt = logging.Formatter(
            '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
            "%Y-%m-%d %H:%M:%S"
        )

        if debug:
            logLevel = logging.DEBUG
        else:
            logLevel = logging.INFO

        self.sh = logging.StreamHandler(sys.stdout)
        self.sh.setLevel(logLevel)
        self.sh.setFormatter(frmt)

        self.fh = logging.FileHandler('autorippr.log')
        self.fh.setLevel(logLevel)
        self.fh.setFormatter(frmt)

        self.log = logging.getLogger(name)
        self.log.setLevel(logLevel)
        self.log.addHandler(self.sh)
        self.log.addHandler(self.fh)

    def __del__(self):
        self.log.removeHandler(self.sh)
{'fraction_non_alphanumeric': 0.13602251407129456, 'fraction_numerical': 0.01876172607879925, 'mean_word_length': 2.3069767441860467, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4072336', 'n_tokens_mistral': 754, 'n_tokens_neox': 700, 'n_words': 135}