<commit_before>import sys
import warnings

from loguru import logger


def setup_logging(loglevel='info', stream_sink=sys.stdout):
    from . import runtime_state

    kwargs = {}
    if sys.stdout.isatty():
        kwargs.update(
            colorize=True
        )
    else:
        kwargs.update(
            colorize=False
        )

    logger.level('TRACE', color='<dim>')
    logger.level('DEBUG', color='<dim><cyan>')
    logger.level('INFO', color='')
    logger.level('WARNING', color='<yellow>')
    logger.level('ERROR', color='<bold><red>')
    logger.level('DIAGNOSTIC', color='<bold><yellow>', no=10)
    logger.level('CRITICAL', color='<bold><red><WHITE>')
    logger.level('SUCCESS', color='<dim><green>')

    config = {
        'handlers': [
            dict(
                sink=stream_sink,
                level=loglevel.upper(),
                format='<level>{message}</level>',<commit_msg>explicitly set log levels<commit_after>import sys
import warnings

from loguru import logger


def setup_logging(loglevel='info', stream_sink=sys.stdout):
    from . import runtime_state

    kwargs = {}
    if sys.stdout.isatty():
        kwargs.update(
            colorize=True
        )
    else:
        kwargs.update(
            colorize=False
        )

    logger.level('TRACE', color='<dim>', no=0)
    logger.level('DEBUG', color='<dim><cyan>', no=10)
    logger.level('INFO', color='', no=20)
    logger.level('SUCCESS', color='<dim><green>', no=30)
    logger.level('WARNING', color='<yellow>', no=30)
    logger.level('ERROR', color='<bold><red>', no=40)
    logger.level('DIAGNOSTIC', color='<bold><yellow>', no=50)
    logger.level('CRITICAL', color='<bold><red><WHITE>', no=60)

    config = {
        'handlers': [
            dict(
                sink=stream_sink,
                level=loglevel.upper(),
                format='<level>{message}</level>',
{'fraction_non_alphanumeric': 0.17142857142857143, 'fraction_numerical': 0.008994708994708995, 'mean_word_length': 2.700587084148728, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '53762', 'n_tokens_mistral': 606, 'n_tokens_neox': 591, 'n_words': 99}