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 >>> logging.basicConfig(level=logging.DEBUG) >>> logging.debug('test') DEBUG:root:test >>> logging.debug('%s', 'test') # example of built-in string interpolation in log messages DEBUG:root:test >>> patch_logging() >>> logging.debug('{0}', 'test') # format syntax not supported unless patched DEBUG:root:test
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
Close
Hashes for logging_unterpolation-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb00249c1b0f2000a359964910c87b071efa4f7fccd6383ec579375bc678edf |
|
MD5 | 771329ef6660a5276afe4f756df5d4d3 |
|
BLAKE2b-256 | 06a00b10ce1db1b7438b3141a27eddf235845652caf993ba32ae2054b5e2547c |