Skip to main content

TidyLog

Clean, colorized structured logging for Python with JSON extra fields.

Installation

pip install tidylog

Usage

Console Logging

from tidylog import get_logger

logger = get_logger(__name__)
logger.info("User logged in", extra={"user_id": 123, "ip": "192.168.1.1"})

Output:

2024-01-15 10:30:00 - myapp - INFO - User logged in - {"user_id": 123, "ip": "192.168.1.1"}

File Logging

from tidylog import setup_file_logging

handler = setup_file_logging(
    "logs/app.log",
    level="DEBUG",
    logger_names=["myapp", "myapp.api"],
)

Examples

# Install in development mode
poetry install

# Run examples
poetry run python examples/console_logging.py
poetry run python examples/file_logging.py
poetry run python examples/custom_formatter.py

Build & Deploy

pip install build twine
python -m build
twine upload dist/*

Metadata

Release files for tidylog 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tidylog 0.2.1
File Size Uploaded Provenance Actions
tidylog-0.2.1.tar.gz 7.6 kB Without provenance Details for tidylog-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tidylog 0.2.1
File Interpreter ABI Platform Actions
tidylog-0.2.1-py3-none-any.whl Python 3 none any Details for tidylog-0.2.1-py3-none-any.whl

Total release size: 17.2 kB

Release files / tidylog-0.2.1.tar.gz

Download URL tidylog-0.2.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3f95a49c62b17cf084bcc460c5453e5f6affa8a41f1a47fd1a62acbbdf0f3e04
BLAKE2b-256 checksum
How to use checksums
130672ea8b4a6dc1466b173ebdbcd790e4f7e6954fb5b3cf23549564cc4966e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / tidylog-0.2.1-py3-none-any.whl

Download URL tidylog-0.2.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39e92b18358f0c117cf66740aed80504422a9326705787d7cc0658142d9ea6e5
BLAKE2b-256 checksum
How to use checksums
54f5b87dcc045588fdb6175617685e137d187ff0686e18256afb3096e704e693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Security for tidylog 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page