logging_unterpolation 0.1.0
patch logging module to accept PEP-3101 formatting syntax
Latest Version: 0.2.0
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
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| logging_unterpolation-0.1.0.tar.gz (md5) | Source | 2011-12-22 | 5KB | 218 | |
- Author: Rob Dennis
- Home Page: https://bitbucket.org/rdennis463/logging_unterpolation/
- License: MIT License
- Platform: OS Independent
- Categories
- Package Index Owner: Rob.Dennis
- DOAP record: logging_unterpolation-0.1.0.xml
