<commit_before>try:
    import dog_config as cfg
except ModuleNotFoundError:
    print('err: dog_config.py not found')

import logging
import asyncio
import uvloop
from os import listdir
from dog import DogBot

# uvloop for speedups
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

# configure logging
# set the root logger's info to INFO
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)

# pretty formatting
console_fmt = logging.Formatter('[%(levelname)s] %(name)s: %(message)s')
nice_fmt = logging.Formatter('%(asctime)s '
                             '[%(name)s %(levelname)s] %(message)s')

# discord log should be DEBUG, but only in dog.log
discord_logger = logging.getLogger('discord')
discord_logger.setLevel(logging.DEBUG)
file_handler = logging.FileHandler(filename='dog.log', encoding='utf-8',
                                   mode='w')
file_handler.setFormatter(nice_fmt)

# stream handler (stdout), only handle INFO+
stream = logging.StreamHandler()
stream.setFormatter(console_fmt)
stream.setLevel(logging.INFO)

# handle from all logs
root_logger.addHandler(stream)
root_logger.addHandler(file_handler)

logger = logging.getLogger('dog')

logger.info('bot starting')

d = DogBot(command_prefix=cfg.prefix)

exts = 'dog/ext'
d_exts = [p.replace('.py', '') for p in listdir(exts) if p != '__pycache__']

for ext in d_exts:
    logger.info('loading extension dog.ext.%s', ext)
    d.load_extension(f'dog.ext.{ext}')

d.run(cfg.token)<commit_msg>move debug log into dog_debug.log<commit_after>try:
    import dog_config as cfg
except ModuleNotFoundError:
    print('err: dog_config.py not found')

import logging
import asyncio
import uvloop
from os import listdir
from dog import DogBot

# uvloop for speedups
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

# configure logging
# set the root logger's info to INFO
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)

# pretty formatting
console_fmt = logging.Formatter('[%(levelname)s] %(name)s: %(message)s')
nice_fmt = logging.Formatter('%(asctime)s '
                             '[%(name)s %(levelname)s] %(message)s')

# discord log should be DEBUG, but only in dog.log
discord_logger = logging.getLogger('discord')
discord_logger.setLevel(logging.DEBUG)
file_handler = logging.FileHandler(filename='dog_debug.log', encoding='utf-8',
                                   mode='w')
file_handler.setFormatter(nice_fmt)

file_sane_handler = logging.FileHandler(filename='dog.log', encoding='utf-8',
                                        mode='w')
file_sane_handler.setFormatter(nice_fmt)
file_sane_handler.setLevel(logging.INFO)

# stream handler (stdout), only handle INFO+
stream = logging.StreamHandler()
stream.setFormatter(console_fmt)
stream.setLevel(logging.INFO)

# handle from all logs
root_logger.addHandler(stream)
root_logger.addHandler(file_handler)
root_logger.addHandler(file_sane_handler)

logger = logging.getLogger('dog')

logger.info('bot starting')

d = DogBot(command_prefix=cfg.prefix)

exts = 'dog/ext'
d_exts = [p.replace('.py', '') for p in listdir(exts) if p != '__pycache__']

for ext in d_exts:
    logger.info('loading extension dog.ext.%s', ext)
    d.load_extension(f'dog.ext.{ext}')

d.run(cfg.token)
{'fraction_non_alphanumeric': 0.1235782354749462, 'fraction_numerical': 0.0009222256378727329, 'mean_word_length': 4.59106529209622, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '426762', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1045, 'n_words': 234}