Skip to main content

__emit__: all-in-one logging, tracing and auditing

Project description

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-emit-0.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

python_emit-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file python-emit-0.0.1.tar.gz.

File metadata

  • Download URL: python-emit-0.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.7

File hashes

Hashes for python-emit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 89e730b60db57d96e14c7f17099861b474915e27fbbdfa2b2198c5a75908e016
MD5 960713c2257487fe8e84a0a770858577
BLAKE2b-256 f4fc4bbe733ca7891b994069f941c5ab17491c5a807d431ae0d1cb157f2b1c82

See more details on using hashes here.

File details

Details for the file python_emit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: python_emit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.7

File hashes

Hashes for python_emit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 440d8ddc4b887a0004f83377e4f1b24d0818b5241b48ac13fa7d1879b0562206
MD5 8d22443734a695184761e0c2c4e2b87f
BLAKE2b-256 1e6c6bff40848b7df748763d205d979f6b8062265a7a34b35cca4bb688a74a90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page