Skip to main content

logbind

Project description

https://travis-ci.org/cjrh/logbind.svg?branch=master https://coveralls.io/repos/github/cjrh/logbind/badge.svg?branch=master https://img.shields.io/pypi/pyversions/logbind.svg https://img.shields.io/github/tag/cjrh/logbind.svg https://img.shields.io/badge/install-pip%20install%20logbind-ff69b4.svg https://img.shields.io/pypi/v/logbind.svg https://img.shields.io/badge/calver-YYYY.MM.MINOR-22bfda.svg

logbind

Easily bind new fields into your logger instances.

# Original logger
logger = logging.getLogger('a')
logger.info('Hello')

logger = logbind.bind(logger, id=12345)
logger.info('Hello')  # <- This logrecord has an extra field "id"

logger = logbind.bind(logger, abc=67890)
logger.info('Hello')  # <- logrecord has two extra fields: "id" and "abc"

This feature will be most useful with a structured logging formatter, such as JSON. You could try logjson for example.

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

logbind-2017.11.7.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

logbind-2017.11.7-py2.py3-none-any.whl (13.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file logbind-2017.11.7.tar.gz.

File metadata

  • Download URL: logbind-2017.11.7.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for logbind-2017.11.7.tar.gz
Algorithm Hash digest
SHA256 1631e2b10138aa4eeece554cadcb738ca2f5be562ba7b3abd2c8cbacaa9bcaea
MD5 83b1b2c16db9ae10df0570ac46396b23
BLAKE2b-256 289bfa87d1f36ee15882f05bd8a1f66f7d0ad117dade6819ef77eac09581c69e

See more details on using hashes here.

File details

Details for the file logbind-2017.11.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for logbind-2017.11.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a57930b3d87f26cc803abd185f2bdfb6eb6be221a3cc8d1496549e289ffa9625
MD5 466cbe8e748e770285f342ffd5aedc69
BLAKE2b-256 1660f3e5c0dc5b1c5693d8571ef23344d7a85578fe6ebea15de537128b100034

See more details on using hashes here.

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