<commit_before>import asyncio
import aiohttp
import importlib
import logging

from .protocol import JsonRpcMsgTyp, decode_msg, encode_result, encode_error
from .websocket import JsonWebSocketResponse
from .communicaton import JsonRpcRequest
from .auth import DummyAuthBackend

from .exceptions import (
    RpcInvalidRequestError,
    RpcMethodNotFoundError,
    RpcInvalidParamsError,
    RpcInternalError,
    RpcError,
)


class JsonRpc(object):
    def __init__(self, auth_backend=None):
        self.clients = []
        self.methods = {}
        self.topics = {}
        self.state = {}

        # auth backend
        if not auth_backend:
            self.auth_backend = DummyAuthBackend()

        else:
            self.auth_backend = auth_backend

        # setup logging
        formatter = logging.Formatter(
            fmt='%(levelname)s:{}: %(message)s'.format(
                self.__class__.__name__)
        )

        handler = logging.StreamHandler()
        handler.setFormatter(formatter)
        self.logger = logging.getLogger(self.__class__.__name__)
        self.logger.addHandler(handler)

        # methods
        self.add_methods(
            ('', self.get_methods),
            ('', self.get_topics),
            ('', self.get_subscriptions),
            ('', self.subscribe),<commit_msg>JsonRpc: remove obsolete logging formatter<commit_after>import asyncio
import aiohttp
import importlib
import logging

from .protocol import JsonRpcMsgTyp, decode_msg, encode_result, encode_error
from .websocket import JsonWebSocketResponse
from .communicaton import JsonRpcRequest
from .auth import DummyAuthBackend

from .exceptions import (
    RpcInvalidRequestError,
    RpcMethodNotFoundError,
    RpcInvalidParamsError,
    RpcInternalError,
    RpcError,
)


class JsonRpc(object):
    def __init__(self, auth_backend=None, logger=None):
        self.clients = []
        self.methods = {}
        self.topics = {}
        self.state = {}
        self.logger = logging.getLogger('aiohttp-json-rpc.server')

        # auth backend
        if not auth_backend:
            self.auth_backend = DummyAuthBackend()

        else:
            self.auth_backend = auth_backend

        # methods
        self.add_methods(
            ('', self.get_methods),
            ('', self.get_topics),
            ('', self.get_subscriptions),
            ('', self.subscribe),
{'fraction_non_alphanumeric': 0.09128978224455611, 'fraction_numerical': 0.0, 'mean_word_length': 2.5445103857566767, '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': '2190200', 'n_tokens_mistral': 681, 'n_tokens_neox': 659, 'n_words': 139}