logfmt 📝
Beautiful, structured console logging for Python.
Installation
pip install logfmt
Usage
from logfmt import Logger
log = Logger("myapp")
log.debug("Debugging info", variable=42)
log.info("Server started", port=8080, host="0.0.0.0")
log.warning("High memory usage", percent=85)
log.error("Connection failed", host="db.example.com", retry=3)
log.critical("System shutdown imminent")
Output
2025-12-18 10:30:45 INFO [myapp] Server started port=8080 host=0.0.0.0
2025-12-18 10:30:46 WARN [myapp] High memory usage percent=85
2025-12-18 10:30:47 ERROR [myapp] Connection failed host=db.example.com retry=3
Features
- 🎨 Colored output (auto-detected)
- 📊 Structured key-value logging
- ⏰ Timestamps
- 🎚️ Log levels
- 📤 Configurable output stream
Configuration
from logfmt import Logger, LogLevel
log = Logger(
name="myapp",
level=LogLevel.DEBUG, # Minimum log level
colorize=True, # Enable colors
timestamp=True, # Show timestamps
)
Log Levels
| Level | Value | Use Case |
|---|---|---|
| DEBUG | 10 | Detailed debugging |
| INFO | 20 | General information |
| WARNING | 30 | Warning messages |
| ERROR | 40 | Error conditions |
| CRITICAL | 50 | Critical failures |
License
MIT
Metadata
Release files for pylogfmt-rj 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylogfmt_rj-1.0.0.tar.gz | 3.5 kB | Without provenance | Details for pylogfmt_rj-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylogfmt_rj-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pylogfmt_rj-1.0.0-py3-none-any.whl |
Total release size: 7.3 kB
Release files / pylogfmt_rj-1.0.0.tar.gz
| Download URL | pylogfmt_rj-1.0.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eef65cc33de62a396d082aa92d4ebd1a622ce1fa1accf93309fbd9014466a25d
|
|
BLAKE2b-256 checksum How to use checksums |
4a39100ca093a8bbada473250dfab82bd42d0e0379f7c9951b57350b047aaa51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / pylogfmt_rj-1.0.0-py3-none-any.whl
| Download URL | pylogfmt_rj-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea6457551ff6f52dbb1a370e0336c6d236be2cdd8046826fd2dab3042a4f02fc
|
|
BLAKE2b-256 checksum How to use checksums |
89db8e6a289c9e851902dda5be6f312c9f332eaf4dd55517dafdf5feb97252a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for pylogfmt-rj 1.0.0
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.