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.

Files for logging_unterpolation, version 0.1.0a3
Filename, size File type Python version Upload date Hashes
Filename, size logging_unterpolation-0.1.0a3.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page