Skip to main content

Wrap standard-library logging to support TQDM progress-bars.

Project description

TQDM logging wrapper

Wrap standard-library logging to support TQDM progress-bars.

Installation

pip install tqdm-logging-wrapper

Usage

import logging

import tqdm
import tqdm_logging_wrapper

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)

items = [1, 2, 3]
items_iter = tqdm.tqdm(items)
logger.info(f"Items: {items}")
with tqdm_logging_wrapper.wrap_logging_for_tqdm(items_iter), items_iter:
    for item in items_iter:
        logger.info(f"Item: {item}")
logger.info(f"Items: {items}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tqdm-logging-wrapper-1.0.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

tqdm_logging_wrapper-1.0.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page