<commit_before># -*- coding: utf-8 -*-
import logging
import os

logger = logging.getLogger(__name__)


def load_logging_config(options):
    handler_config = {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'console',
        },
    }
    handlers = ['console']
    sentry_handler = []
    frigg_level = options['loglevel']
    if options['sentry_dsn'] and 'TESTING' not in os.environ:
        handlers = ['console', 'sentry']
        sentry_handler = ['sentry']
        handler_config['sentry'] = {
            'level': 'ERROR',
            'class': 'raven.handlers.logging.SentryHandler',
            'dsn': options['sentry_dsn']
        }

    return {
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'console': {
                'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
                'datefmt': '%H:%M:%S',
            },
        },
        'handlers': handler_config,
        'loggers': {
            '': {
                'handlers': sentry_handler,
                'level': 'ERROR',
                'propagate': True,
            },
            'requests': {
                'handlers': handlers,
                'level': 'ERROR',
                'propagate': True,
            },
            'frigg': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
            'frigg_coverage': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
            'frigg_worker': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
        }
    }
<commit_msg>Add docker wrapper to logging config<commit_after># -*- coding: utf-8 -*-
import logging
import os

logger = logging.getLogger(__name__)


def load_logging_config(options):
    handler_config = {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'console',
        },
    }
    handlers = ['console']
    sentry_handler = []
    frigg_level = options['loglevel']
    if options['sentry_dsn'] and 'TESTING' not in os.environ:
        handlers = ['console', 'sentry']
        sentry_handler = ['sentry']
        handler_config['sentry'] = {
            'level': 'ERROR',
            'class': 'raven.handlers.logging.SentryHandler',
            'dsn': options['sentry_dsn']
        }

    return {
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'console': {
                'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
                'datefmt': '%H:%M:%S',
            },
        },
        'handlers': handler_config,
        'loggers': {
            '': {
                'handlers': sentry_handler,
                'level': 'ERROR',
                'propagate': True,
            },
            'requests': {
                'handlers': handlers,
                'level': 'ERROR',
                'propagate': True,
            },
            'docker': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
            'frigg': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
            'frigg_coverage': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
            'frigg_worker': {
                'handlers': handlers,
                'level': frigg_level,
                'propagate': True,
            },
        }
    }

{'fraction_non_alphanumeric': 0.1437125748502994, 'fraction_numerical': 0.001041395469929706, 'mean_word_length': 1.3469761759315821, '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': '1332163', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1064, 'n_words': 200}