Skip to main content

Management and injection of contextual variables into log messages.

Reason this release was yanked:

invalid version

Project description

CICD

Enabling

The core module provides a logging.Filter subclass designed to inject the current active context into any log messages.

Below is a demo usage on how to enable context injection:

import logging
import logctx

root_logger = logging.getLogger()
console_handler = logging.StreamHandler()

formatter = jsonlogger.JsonFormatter("%(logctx)s")
context_filter = ContextInjectingLoggingFilter(output_field="logctx")

console_handler.setFormatter(formatter)
console_handler.addFilter(context_filter)

root_logger.addHandler(console_handler)
logger.setLevel(logging.DEBUG)

Generators

  • During execution
  • Between yields

Log Arguments

  • Raises during initializtaion
  • Value Error
  • Able to rename args
  • Unable to extract from kwargs
  • Unable to work on generators
  • Unable to work on async functions

update

  • can change root context

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

logctx-0.1.1.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logctx-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file logctx-0.1.1.tar.gz.

File metadata

  • Download URL: logctx-0.1.1.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for logctx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e25752947e58fa14dbcbafdb95eb7140d835da1b234db9b33f4011648feec399
MD5 e279f5707919c494dcc848925bdc61ed
BLAKE2b-256 4d8b288c403b4755d413862b27b8fd1ca14aa6f178bd56535270552f1102e83a

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.1.1.tar.gz:

Publisher: release.yml on aschulte201/logctx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file logctx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: logctx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for logctx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42baa298851c68a44d912ba75b88144ba8495995fac8812e855cbb62aa88840b
MD5 83efb464be141cfe0d52495764d603dc
BLAKE2b-256 01791fd19e98ea26e519d5778d554a7b7b20be334b3e4f611cd11eecd2e9017f

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.1.1-py3-none-any.whl:

Publisher: release.yml on aschulte201/logctx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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