logbind
Project description
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
Release history Release notifications | RSS feed
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.6.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for logbind-2017.11.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa31bfe4a3ea2ff706e57fb4f96964ed9c6d18ef718c2a86e2f09ff9b08d7c90 |
|
MD5 | 4e01d714753a7165dd8c58a67f406a74 |
|
BLAKE2b-256 | 5024d2199222b804aaf95ed6512e6fe10d4d7c3a17737fc31425cb58b63e49de |