<commit_before>from .client import ElasticsearchClient


class ElasticManager(object):
    def __init__(self):
        self.client = ElasticsearchClient()<commit_msg>Handling unavailable ES backend in `ElasticManager` - it should inform and pass.<commit_after>import logging

from django.conf import settings

from .client import ElasticsearchClient
from .exceptions import ElasticsearchClientConfigurationError


# logger = getLogger('elastic_django')


class ElasticManager(object):
    def __init__(self):
        try:
            self.client = ElasticsearchClient()
        except ElasticsearchClientConfigurationError:
            message = 'Elasticsearch connection unavailable.'
            logging.exception(message) if settings.DEBUG else logging.critical(
                message)
{'fraction_non_alphanumeric': 0.0670886075949367, 'fraction_numerical': 0.0, 'mean_word_length': 3.823170731707317, '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': '3679021', 'n_tokens_mistral': 188, 'n_tokens_neox': 186, 'n_words': 54}