<commit_before>from bridge import client, data, peer
from typing import List
import asyncio
import glob
import logging
import random
import traceback

DEBUG = True

logging_format = "[%(levelname)s]\t{%(asctime)s}\t%(name)s: %(message)s"
logging.basicConfig(filename="run.log", level=logging.DEBUG, format=logging_format)

bridge_logger = logging.getLogger("bridge")
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter("[%(name)s] - %(message)s"))
ch.setLevel(logging.DEBUG)
bridge_logger.addHandler(ch)

app_logger = logging.getLogger("bridge.app")
peer_id = peer.generate_peer_id(debug=DEBUG).encode()
listen_port = random.randrange(6881, 6889)


async def load_files() -> List[data.Torrent]:
    torrent_list = glob.glob("./*.torrent")
    return [data.Torrent(f) for f in torrent_list]<commit_msg>Console logger attaches to root logger<commit_after>from bridge import client, data, peer
from typing import List
import asyncio
import glob
import logging
import random
import traceback

DEBUG = True

logging_format = "[%(levelname)s]\t{%(asctime)s}\t%(name)s: %(message)s"
logging.basicConfig(filename="run.log", level=logging.DEBUG, format=logging_format)

async_logger = logging.getLogger("asyncio")
ach = logging.StreamHandler()
ach.setFormatter(logging.Formatter("[%(name)s] - %(message)s"))
ach.setLevel(logging.ERROR)
async_logger.addHandler(ach)

bridge_logger = logging.getLogger("bridge")
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter("[%(name)s] - %(message)s"))
ch.setLevel(logging.DEBUG)
bridge_logger.addHandler(ch)

app_logger = logging.getLogger("bridge.app")
peer_id = peer.generate_peer_id(debug=DEBUG).encode()
listen_port = random.randrange(6881, 6889)


async def load_files() -> List[data.Torrent]:
    torrent_list = glob.glob("./*.torrent")
    return [data.Torrent(f) for f in torrent_list]
{'fraction_non_alphanumeric': 0.14525745257452574, 'fraction_numerical': 0.008672086720867209, 'mean_word_length': 6.956896551724138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2671128', 'n_tokens_mistral': 621, 'n_tokens_neox': 600, 'n_words': 122}