<commit_before>import logging
import modules.utils

class WebSocketLogger(logging.StreamHandler):

    """
    A handler class which allows the cursor to stay on
    one line for selected messages
    """
    
    def __init__(self, listener):
        super().__init__()
        self.listener = listener

    def emit(self, record):
        try:
            packet = {'category': 'log', 'message': self.format(record), 'type': record.levelno}
            self.listener.send_data(modules.utils.getJSON(packet))
            self.flush()
        except NameError:
            print('The server thread has not been created yet. Dropping log output.')
        except:
            self.handleError(record)

        <commit_msg>Added unimplemented `ConsoleFormatter`; changed logging configuration<commit_after>import logging
import modules.utils

class WebSocketLogger(logging.Handler):

    """
    A handler class which allows the cursor to stay on
    one line for selected messages
    """
    
    def __init__(self, listener):
        super().__init__()
        self.listener = listener

    def emit(self, record):
        try:
            packet = {'category': 'log', 'message': self.format(record), 'type': record.levelno}
            self.listener.send_data(modules.utils.getJSON(packet))
            self.flush()
        except NameError:
            print('The server thread has not been created yet. Dropping log output.')
        except:
            self.handleError(record)
            
class ConsoleFormatter(logging.Formatter):
    def format(self, record):
        if record.levelno  == logging.WARNING:
            # display yellow text
            record.msg = '\033[93m\033[1m%s\033[0m\033[39m' % (record.msg)
        elif record.levelno == logging.ERROR:
            # display red text
            record.msg = '\033[31m\033[1m%s\033[0m\033[39m' % (record.msg)
        elif record.levelno == logging.INFO:
            # display blue text
            record.msg = '\033[94m\033[1m%s\033[0m\033[39m' % (record.msg)
        elif record.levelno == logging.CRITICAL:
            # display bold red text
            record.msg = '\033[31m\033[1m%s\033[0m\033[39m' % (record.msg)
        elif record.levelno == logging.DEBUG:
            # display green text
            record.msg = '\033[92m\033[1m%s\033[0m\033[39m' % (record.msg)
            
        return super(ConsoleFormatter , self).format(record)


        
{'fraction_non_alphanumeric': 0.11372064276885044, 'fraction_numerical': 0.037082818294190356, 'mean_word_length': 2.2330226364846872, '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': '2085360', 'n_tokens_mistral': 743, 'n_tokens_neox': 682, 'n_words': 169}