Skip to main content

patch logging module to accept PEP-3101 formatting syntax

Project description

logging_unterpolation is a very simple module that will patch the built-in logging module to accept PEP-3101 compliant string formatting (using the str.format method) as well as falling back to accept the original string interpolation operator (% or ‘modulo’)

Here’s a basic example:

>>> import logging
from logging_unterpolation import patch_logging
patch_logging()
logging.basicConfig(level=logging.DEBUG)
logging.debug('test')
DEBUG:root:test
logging.debug('%s', 'test')
DEBUG:root:test
logging.debug('{0}', 'test')
DEBUG:root:test

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

logging_unterpolation-0.1.0a1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file logging_unterpolation-0.1.0a1.tar.gz.

File metadata

File hashes

Hashes for logging_unterpolation-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 035b5f13d22ab51e9ba7d4faacc88c9b3e1264e88994feacbb098aa17b585186
MD5 eb05265002d0b748c1f2f830475b661a
BLAKE2b-256 2f5f758551cf0700dca32da72517ad0bf4c02964512269f70219a01e49fd7ab5

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