<commit_before>import logging
import logging.handlers

from mopidy import get_version, get_platform, get_python, settings

def setup_logging(verbosity_level, save_debug_log):
    setup_root_logger()
    setup_console_logging(verbosity_level)
    if save_debug_log:
        setup_debug_logging_to_file()
    logger = logging.getLogger('mopidy.utils.log')
    logger.info(u'Starting Mopidy %s', get_version())
    logger.info(u'OS: %s', get_platform())
    logger.info(u'Python: %s', get_python())

def setup_root_logger():
    root = logging.getLogger('')
    root.setLevel(logging.DEBUG)

def setup_console_logging(verbosity_level):
    if verbosity_level == 0:
        log_level = logging.WARNING
        log_format = settings.CONSOLE_LOG_FORMAT
    elif verbosity_level >= 2:
        log_level = logging.DEBUG
        log_format = settings.DEBUG_LOG_FORMAT
    else:
        log_level = logging.INFO
        log_format = settings.CONSOLE_LOG_FORMAT
    formatter = logging.Formatter(log_format)
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    handler.setLevel(log_level)
    root = logging.getLogger('')
    root.addHandler(handler)

    if verbosity_level < 3:
        logging.getLogger('pykka').setLevel(logging.INFO)

def setup_debug_logging_to_file():
    formatter = logging.Formatter(settings.DEBUG_LOG_FORMAT)
    handler = logging.handlers.RotatingFileHandler(
        settings.DEBUG_LOG_FILENAME, maxBytes=10485760, backupCount=3)
    handler.setFormatter(formatter)<commit_msg>Make log output consistent with --list-deps output<commit_after>import logging
import logging.handlers

from mopidy import get_version, get_platform, get_python, settings

def setup_logging(verbosity_level, save_debug_log):
    setup_root_logger()
    setup_console_logging(verbosity_level)
    if save_debug_log:
        setup_debug_logging_to_file()
    logger = logging.getLogger('mopidy.utils.log')
    logger.info(u'Starting Mopidy %s', get_version())
    logger.info(u'Platform: %s', get_platform())
    logger.info(u'Python: %s', get_python())

def setup_root_logger():
    root = logging.getLogger('')
    root.setLevel(logging.DEBUG)

def setup_console_logging(verbosity_level):
    if verbosity_level == 0:
        log_level = logging.WARNING
        log_format = settings.CONSOLE_LOG_FORMAT
    elif verbosity_level >= 2:
        log_level = logging.DEBUG
        log_format = settings.DEBUG_LOG_FORMAT
    else:
        log_level = logging.INFO
        log_format = settings.CONSOLE_LOG_FORMAT
    formatter = logging.Formatter(log_format)
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    handler.setLevel(log_level)
    root = logging.getLogger('')
    root.addHandler(handler)

    if verbosity_level < 3:
        logging.getLogger('pykka').setLevel(logging.INFO)

def setup_debug_logging_to_file():
    formatter = logging.Formatter(settings.DEBUG_LOG_FORMAT)
    handler = logging.handlers.RotatingFileHandler(
        settings.DEBUG_LOG_FILENAME, maxBytes=10485760, backupCount=3)
    handler.setFormatter(formatter)
{'fraction_non_alphanumeric': 0.09509899383317105, 'fraction_numerical': 0.007789678675754625, 'mean_word_length': 4.188552188552189, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6917189', 'n_tokens_mistral': 977, 'n_tokens_neox': 943, 'n_words': 165}