larzlog
Structured logging — readable, level-filtered logs (text or JSON) for real apps.
When your app runs somewhere you can't see, logs are your eyes. larzlog is a small
structured logger: levels you can filter, key=value context fields, output as
human-readable text or machine-readable JSON, and bind to attach context (like a
request id) to every line. Everything is injectable (output, clock) so it's easy to
test. Zero dependencies.
Install
pip install larzlog
Use
from larzlog import Logger
log = Logger("api", level="INFO")
log.info("user signed up", user_id=42, plan="pro")
# INFO api: user signed up user_id=42 plan=pro
req = log.bind(request_id="abc123")
req.warning("slow response", ms=812)
Learn to code with Larz
Part of the learn-to-code toolkit in the Larz stack — see the Learn to Code platform. A building block for running apps in production.
Tests
python -m unittest discover -s tests -v # 5 tests
License
MIT (c) larz-scripter
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 larzlog-0.1.0.tar.gz.
File metadata
- Download URL: larzlog-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb3f7461bbea219011695f214477e141306a0a7f261980d5c90bf2fb7ae7adfa
|
|
| MD5 |
963bbee1395f029491f56f0d03c68cc4
|
|
| BLAKE2b-256 |
7329fad030b590ce7fbbca44139d7bd76a7fca43a8174e9ebd18c37788feb4f2
|
File details
Details for the file larzlog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: larzlog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81dabc0fe085a069ed528ce9453d36f2a1afbe4fd76b24b3f8a8bd000202797e
|
|
| MD5 |
19745d88affed03ac774e63a5a486f5a
|
|
| BLAKE2b-256 |
b90823ac3181913947f1514452a1e43f1a0421404636184319671bd86759cf36
|