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.0.tar.gz (28.1 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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: logctx-0.1.0.tar.gz
  • Upload date:
  • Size: 28.1 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.0.tar.gz
Algorithm Hash digest
SHA256 6126d181a1c649fd6f4ec3fc9fa2c5c0638d50e46f25aa5e0353915663fd33d9
MD5 07c4467cede1542c069cdc3cfb6db3dd
BLAKE2b-256 a261f7d137f5b3817fb2857a6e6600038534d4f5dba0acd8233823dc424c0dad

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: logctx-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75d64fb54c68e294be64b11adc9763298a0a87de74f624b7ffd3c3ed48940288
MD5 f3fcb43ed1755e2d16ff85ad59834046
BLAKE2b-256 22d8b03b754767d857398ea196ee9fff727caf1bdfedf4d8ebde781e8abae8e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.1.0-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