<commit_before>from os.path import join


def create_logging_conf(logdir):
    return {
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'verbose': {
                'format': '[%(levelname)s %(asctime)s %(name)s] %(message)s'
            },
            'simple': {
                'format': '[%(levelname)s] %(message)s'
            },
        },

        'handlers': {
            # 'sentry': {
            #     'level': 'DEBUG',
            #     'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
            # },
            'console': {
                'level': 'DEBUG',
                'formatter': 'verbose',
                'class': 'logging.StreamHandler'
            },
            'allButExceptionTracebacks': {
                'level': 'DEBUG',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'all-but-exceptiontracebacks.devilry.log'),
            },
            'dbfile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'dberrors.devilry.log')
            },
            'dbdebugfile': {  # Shows the SQL statements
                              'level': 'DEBUG',
                              'formatter': 'verbose',
                              'class': 'logging.FileHandler',
                              'filename': join(logdir, 'debug-containing-sqlstatements.db.devilry.log')
                              },
            'requestfile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'request.devilry.log')
            },
            'exceptionTracebacksFile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'exception.devilry.log')
            }
        },
        'loggers': {
            'devilry.utils.logexceptionsmiddleware': {
                'handlers': ['exceptionTracebacksFile', 'console'],  # , 'sentry'],
                'level': 'ERROR',
                'propagate': False
            },
            'django.request': {
                'handlers': ['allButExceptionTracebacks',
                             'requestfile'],
                'level': 'ERROR',
                'propagate': False
            },
            'django.db.backends': {
                'handlers': ['allButExceptionTracebacks',
                             'dbfile',
                             # 'console', # Comment in to see SQL statements in the log
                             'dbdebugfile'
                             # Not useful for production since SQL statement logging is disabled when DEBUG=False.
                             ],
                'level': 'DEBUG',
                'propagate': False
            },
            'devilry.utils.devilry_email': {
                'handlers': ['allButExceptionTracebacks',
                             # 'sentry',
                             ],
                'level': 'DEBUG',
                'propagate': False
            },
            'selenium.webdriver.remote.remote_connection': {
                'handlers': ['allButExceptionTracebacks', 'console'],
                'level': 'INFO',
                'propagate': False
            },
            'devilry.devilry_search.tasks': {
                'handlers': ['allButExceptionTracebacks'],
                'level': 'INFO',
                'propagate': False
            },
            'sh': {  # Affects the output of django_dbdev, and any other library using the ``sh`` library
                     'handlers': ['console'],
                     'level': 'WARNING',
                     'propagate': True
                     },
            '': {
                'handlers': ['allButExceptionTracebacks',
                             # 'sentry',
                             'console'],
                'level': 'DEBUG',
                'propagate': False
            },
            'elasticsearch': {
                'handlers': ['console'],
                'level': 'WARNING',
                'propagate': False
            },<commit_msg>project.develop.settings: Suppress haystack log.<commit_after>from os.path import join


def create_logging_conf(logdir):
    return {
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'verbose': {
                'format': '[%(levelname)s %(asctime)s %(name)s] %(message)s'
            },
            'simple': {
                'format': '[%(levelname)s] %(message)s'
            },
        },

        'handlers': {
            # 'sentry': {
            #     'level': 'DEBUG',
            #     'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
            # },
            'console': {
                'level': 'DEBUG',
                'formatter': 'verbose',
                'class': 'logging.StreamHandler'
            },
            'allButExceptionTracebacks': {
                'level': 'DEBUG',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'all-but-exceptiontracebacks.devilry.log'),
            },
            'dbfile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'dberrors.devilry.log')
            },
            'dbdebugfile': {  # Shows the SQL statements
                              'level': 'DEBUG',
                              'formatter': 'verbose',
                              'class': 'logging.FileHandler',
                              'filename': join(logdir, 'debug-containing-sqlstatements.db.devilry.log')
                              },
            'requestfile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'request.devilry.log')
            },
            'exceptionTracebacksFile': {
                'level': 'ERROR',
                'formatter': 'verbose',
                'class': 'logging.FileHandler',
                'filename': join(logdir, 'exception.devilry.log')
            }
        },
        'loggers': {
            'devilry.utils.logexceptionsmiddleware': {
                'handlers': ['exceptionTracebacksFile', 'console'],  # , 'sentry'],
                'level': 'ERROR',
                'propagate': False
            },
            'django.request': {
                'handlers': ['allButExceptionTracebacks',
                             'requestfile'],
                'level': 'ERROR',
                'propagate': False
            },
            'django.db.backends': {
                'handlers': ['allButExceptionTracebacks',
                             'dbfile',
                             # 'console', # Comment in to see SQL statements in the log
                             'dbdebugfile'
                             # Not useful for production since SQL statement logging is disabled when DEBUG=False.
                             ],
                'level': 'DEBUG',
                'propagate': False
            },
            'devilry.utils.devilry_email': {
                'handlers': ['allButExceptionTracebacks',
                             # 'sentry',
                             ],
                'level': 'DEBUG',
                'propagate': False
            },
            'selenium.webdriver.remote.remote_connection': {
                'handlers': ['allButExceptionTracebacks', 'console'],
                'level': 'INFO',
                'propagate': False
            },
            'devilry.devilry_search.tasks': {
                'handlers': ['allButExceptionTracebacks'],
                'level': 'INFO',
                'propagate': False
            },
            'sh': {  # Affects the output of django_dbdev, and any other library using the ``sh`` library
                     'handlers': ['console'],
                     'level': 'WARNING',
                     'propagate': True
                     },
            '': {
                'handlers': ['allButExceptionTracebacks',
                             # 'sentry',
                             'console'],
                'level': 'DEBUG',
                'propagate': False
            },
            'devilry.devilry_search.haystack_signal_processor': {
                'handlers': ['console'],
                'level': 'WARNING',
                'propagate': False
            },
            'elasticsearch': {
                'handlers': ['console'],
                'level': 'WARNING',
                'propagate': False
            },
{'fraction_non_alphanumeric': 0.13121516164994426, 'fraction_numerical': 0.0002229654403567447, 'mean_word_length': 1.148227969348659, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3091470', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2127, 'n_words': 402}