Emit
A Python library for understated tracing and structured logging.
TL;DR
# This is the big idea. Now let's use it.
def emit(obj):
return obj.__emit__()
Logging
from emit import emit, Info, Warning
def frobulate_the_quartzle():
# This works like you expect, no more logger = logging.getLogger(__name__).
# just emit and the log will originate from the right place.
emit(Info("Frobulating the quartzle"))
if not Quartzle.is_polarized():
emit(Warning("Quartzle isn't polarized, results may be different than expected."))
Structured Logging
from emit import emit, Context
def push_noins():
emit(Info("Noins updated."))
def shuffle_lorpizoids():
emit(Context(current_user="Harry Styles"))
# The log emitted from this code will include the current_user context.
push_noins()
Say No To Passing Around Loggers Just To Bind Values
# In `structlog`
log = log.bind(key=value)
# In `emit`
emit(Context(key=value))
Release files for python-emit 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-emit-0.0.1.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_emit-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / python-emit-0.0.1.tar.gz
| Download URL | python-emit-0.0.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89e730b60db57d96e14c7f17099861b474915e27fbbdfa2b2198c5a75908e016
|
|
BLAKE2b-256 checksum How to use checksums |
f4fc4bbe733ca7891b994069f941c5ab17491c5a807d431ae0d1cb157f2b1c82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.7
|
Release files / python_emit-0.0.1-py3-none-any.whl
| Download URL | python_emit-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
440d8ddc4b887a0004f83377e4f1b24d0818b5241b48ac13fa7d1879b0562206
|
|
BLAKE2b-256 checksum How to use checksums |
1e6c6bff40848b7df748763d205d979f6b8062265a7a34b35cca4bb688a74a90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.7
|