修改日志模块以接受PEP-3101格式化语法
项目描述
logging_unterpolation是一个非常简单的模块,它将修改内置的日志模块以接受PEP-3101兼容的字符串格式化(使用str.format方法),以及回退到接受原始字符串插值运算符(%或“取模”)
以下是一个基本示例
>>> 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
项目详情
关闭
logging_unterpolation-0.2.0.tar.gz的散列值
| 算法 | 散列摘要 | |
|---|---|---|
| SHA256 | 8bca6fb1aca94568d8f6a9b104bc057d09397a3f3c780b65a26c445c1446ebed |
|
| MD5 | d0d4de0763be1a1cf044e7ddcce8e1a8 |
|
| BLAKE2b-256 | ac678d5057b171de77c81b48705ab0dcc7a9fcdd3118e169a5b94839da8cb145 |