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
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
File details
Details for the file logging_unterpolation-0.1.0a3.tar.gz
.
File metadata
- Download URL: logging_unterpolation-0.1.0a3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8b3b222730e432dd1f904bb6d9e3cfbf2b6e9ce57a8a4e43868fc7c8abdff5e |
|
MD5 | 8ff80ad29e1f7105ec91ac663a20e351 |
|
BLAKE2b-256 | ba2224c5539c117c8c08cf7c3bb83f71d56797be06dcae35f3bd2dafb0c09108 |