Logging utilities that work well with tqdm
Project description
Installation
pip install logging-tee
Usage
import logging
from tqdm import tqdm
import time
from logging_tee import setup_logger
if __name__ == "__main__":
setup_logger(log_file="output.log", level=logging.DEBUG)
logger = logging.getLogger(__name__)
for i in tqdm(
range(2),
desc="Processing",
):
time.sleep(0.03)
logger.info("Processing item %d", i)
for outer_idx in tqdm(
range(2),
desc="Outer",
):
for inner_idx in tqdm(
range(3),
desc=f"Inner {outer_idx}",
):
time.sleep(0.02)
if inner_idx % 5 == 0:
print(f"Nested step outer={outer_idx} inner={inner_idx}")
logger.info(f"Completed outer={outer_idx}")
print("from print statement")
print("multiple lines\nfrom print statement 2")
logger.debug("Single line")
logger.debug("Multiple lines:\nnext line")
logger.debug("Another single line")
logger.debug("Multiple lines:\n%s", "next line\nnext line 2")
logger.warning("Warning message\nwith multiple lines\nand should be logged properly.")
logger.error("Error message\nwith multiple lines\nand should be logged properly.")
raise ValueError("This is an error message\nwith multiple lines\nand should be logged properly.")
Contributing
Build the package
python -m pip install build
python -m build
python install dist/*.whl
python -c "import logging_tee; print(logging_tee)"
Upload to TestPyPI first
python -m pip install twine
python -m twine upload --repository testpypi dist/*
Upload to PyPi
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logging_tee-1.0.1.tar.gz.
File metadata
- Download URL: logging_tee-1.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be06b9deceb519d71c235eeaad1b24d8838665fa3b6363840706ae0d97d28836
|
|
| MD5 |
1795fe9969d9b8b0a977bea597b4003b
|
|
| BLAKE2b-256 |
60c16aed74efa554f36aba22a29716ea531562e7442b52f3a3b5d8f6d1deadd6
|
Provenance
The following attestation bundles were made for logging_tee-1.0.1.tar.gz:
Publisher:
pypi.yml on jasonrichdarmawan/logging-tee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logging_tee-1.0.1.tar.gz -
Subject digest:
be06b9deceb519d71c235eeaad1b24d8838665fa3b6363840706ae0d97d28836 - Sigstore transparency entry: 1964765887
- Sigstore integration time:
-
Permalink:
jasonrichdarmawan/logging-tee@03b6c87ab254cf5793d743527e88f56f88b11e13 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/jasonrichdarmawan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@03b6c87ab254cf5793d743527e88f56f88b11e13 -
Trigger Event:
release
-
Statement type:
File details
Details for the file logging_tee-1.0.1-py3-none-any.whl.
File metadata
- Download URL: logging_tee-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6949f117026c87f73330e4b6cec347c55b8cacb67856d414638aad171ba0201e
|
|
| MD5 |
47d9a578b1b0cac0bd7317bf71b04a2a
|
|
| BLAKE2b-256 |
20c5c55a7e0f1ae1015e2d62c96b1287bc78ce1ece70cfab1ea8b46f71e9ab5a
|
Provenance
The following attestation bundles were made for logging_tee-1.0.1-py3-none-any.whl:
Publisher:
pypi.yml on jasonrichdarmawan/logging-tee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logging_tee-1.0.1-py3-none-any.whl -
Subject digest:
6949f117026c87f73330e4b6cec347c55b8cacb67856d414638aad171ba0201e - Sigstore transparency entry: 1964765974
- Sigstore integration time:
-
Permalink:
jasonrichdarmawan/logging-tee@03b6c87ab254cf5793d743527e88f56f88b11e13 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/jasonrichdarmawan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@03b6c87ab254cf5793d743527e88f56f88b11e13 -
Trigger Event:
release
-
Statement type: