import logging
import click


def progressbar(*args, **kwargs):
    """
    Slight extension to click's progressbar disabling output on when log level
    is set below 30.
    """
    logger = logging.getLogger(__name__)
    bar = click.progressbar(*args, **kwargs)
    if logger.getEffectiveLevel() < 30:
        bar.is_hidden = True  # type: ignore
    return bar