<commit_before>import logging
from pkg_resources import iter_entry_points

import click
import click_plugins

from . import options
from .. import __version__

_context = dict(
    token_normalize_func=lambda x: x.lower(),
    help_option_names=['--help', '-h'],
    auto_envvar_prefix='TILEZILLA'
)


@click_plugins.with_plugins(ep for ep in
                            iter_entry_points('tilez.commands'))
@click.group(help='tilezilla command line interface',
             context_settings=_context)
@options.opt_config_file
@click.option('--verbose', '-v', is_flag=True, help='Be verbose')
@click.option('--quiet', '-q', is_flag=True, help='Be quiet')
@click.version_option(__version__)
@click.pass_context
def cli(ctx, verbose, quiet):
    # Logging config
    logging.basicConfig()
    logger = logging.getLogger('tilezilla')
    if verbose:
        logger.setLevel(logging.DEBUG)
    if quiet:
        logger.setLevel(logging.WARNING)
<commit_msg>Separate logger for tilez CLI; alter verb/quiet<commit_after>import logging
from pkg_resources import iter_entry_points

import click
import click_plugins

from . import options
from .. import __version__

_context = dict(
    token_normalize_func=lambda x: x.lower(),
    help_option_names=['--help', '-h'],
    auto_envvar_prefix='TILEZILLA'
)

LOG_FORMAT = '%(asctime)s:%(levelname)s:%(message)s'
LOG_DATE_FORMAT = '%H:%M:%S'


@click_plugins.with_plugins(ep for ep in
                            iter_entry_points('tilez.commands'))
@click.group(help='tilezilla command line interface',
             context_settings=_context)
@options.opt_config_file
@click.option('--verbose', '-v', count=True, help='Be louder')
@click.option('--quiet', '-q', count=True, help='Be quieter')
@click.version_option(__version__)
@click.pass_context
def cli(ctx, verbose, quiet):
    verbosity = verbose - quiet
    log_level = 20 - 10 * verbosity

    # Logging config for tilez
    logger = logging.getLogger('tilez')
    formatter = logging.Formatter(LOG_FORMAT, LOG_DATE_FORMAT)
    handler = logging.StreamHandler(click.get_text_stream('stdout'))
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    logger.setLevel(max(10, log_level))  # never below DEBUG (10)

    # Logging for main module
    main_logger = logging.getLogger('tilezilla')
    if log_level <= 0:  # log_level=NOSET (0) sets main logger to debug
        main_logger.setLevel(logging.DEBUG)

{'fraction_non_alphanumeric': 0.12267657992565056, 'fraction_numerical': 0.004130524576621231, 'mean_word_length': 4.1752136752136755, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4401911', 'n_tokens_mistral': 781, 'n_tokens_neox': 751, 'n_words': 166}