<commit_before>import logging
import os
import re
import yaml
from abc import ABCMeta, abstractmethod

PROJECT_CONFIG_EXTENSION = "yaml"

logger = logging.getLogger(__name__)

class ProjectHandlerFactory(object):

    handlers = {}

    def __init__(self):
        self.schema_pattern = re.compile("^({}):\/\/(.+)".format('|'.join(self.handlers.keys())))

    def create(self, uri, local_path):
        """Create a project handler

        Args:
            uri (str): schema://something formatted uri
            local_path (str): the project configs directory

        Return:
            ProjectHandler derived class instance
        """
        matches = self.schema_pattern.search(uri)

        if not matches:
            logger.error("Unknown uri schema: '%s'", uri)
            return None

        schema = matches.group(1)
        url = matches.group(2)

        return self.handlers[schema](url, local_path)<commit_msg>Add some detail to log message<commit_after>import logging
import os
import re
import yaml
from abc import ABCMeta, abstractmethod

PROJECT_CONFIG_EXTENSION = "yaml"

logger = logging.getLogger(__name__)

class ProjectHandlerFactory(object):

    handlers = {}

    def __init__(self):
        self.schema_pattern = re.compile("^({}):\/\/(.+)".format('|'.join(self.handlers.keys())))

    def create(self, uri, local_path):
        """Create a project handler

        Args:
            uri (str): schema://something formatted uri
            local_path (str): the project configs directory

        Return:
            ProjectHandler derived class instance
        """
        matches = self.schema_pattern.search(uri)

        if not matches:
            logger.error("Unknown uri schema: '%s'. Added schemas: %s", uri, self.handlers.keys())
            return None

        schema = matches.group(1)
        url = matches.group(2)

        return self.handlers[schema](url, local_path)
{'fraction_non_alphanumeric': 0.11470281543274244, 'fraction_numerical': 0.0020855057351407717, 'mean_word_length': 2.6139359698681734, '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': '7192512', 'n_tokens_mistral': 541, 'n_tokens_neox': 519, 'n_words': 144}