<commit_before># -*- coding: utf-8 -*-

import logging


class RadricFormatter(logging.Formatter):

    error_fmt = "ERROR - %(msg)s"
    warning_fmt = "WARNING - %(msg)s"
    info_fmt = "[*] %(msg)s"
    debug_fmt = "DEBUG - %(module)s: %(lineno)d: %(msg)s"

    def __init__(self, fmt="[*] %(msg)s"):
        super(RadricFormatter, self).__init__(self, fmt)

    def format(self, record):
        format_orig = self._fmt

        if record.levelno == logging.DEBUG:
            self._fmt = RadricFormatter.debug_fmt

        elif record.levelno == logging.INFO:
            self._fmt = RadricFormatter.info_fmt

        elif record.levelno == logging.WARNING:
            self._fmt = RadricFormatter.warning_fmt

        elif record.levelno == logging.ERROR:
            self._fmt = RadricFormatter.error_fmt

        result = logging.Formatter.format(self, record)
        self._fmt = format_orig

        return result<commit_msg>Fixed Python3 issue<commit_after># -*- coding: utf-8 -*-

import logging


class RadricFormatter(logging.Formatter):

    error_fmt = "ERROR - %(msg)s"
    warning_fmt = "WARNING - %(msg)s"
    info_fmt = "[*] %(msg)s"
    debug_fmt = "DEBUG - %(module)s: %(lineno)d: %(msg)s"

    def __init__(self, fmt="[*] %(msg)s"):
        super(RadricFormatter, self).__init__(fmt)

    def format(self, record):
        format_orig = self._fmt

        if record.levelno == logging.DEBUG:
            self._fmt = RadricFormatter.debug_fmt

        elif record.levelno == logging.INFO:
            self._fmt = RadricFormatter.info_fmt

        elif record.levelno == logging.WARNING:
            self._fmt = RadricFormatter.warning_fmt

        elif record.levelno == logging.ERROR:
            self._fmt = RadricFormatter.error_fmt

        result = logging.Formatter.format(self, record)
        self._fmt = format_orig

        return result
{'fraction_non_alphanumeric': 0.1279443254817987, 'fraction_numerical': 0.0016059957173447537, 'mean_word_length': 2.513157894736842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1299455', 'n_tokens_mistral': 592, 'n_tokens_neox': 571, 'n_words': 118}