The standard Python logging module should contain the useful captureWarnings function , which allows you to integrate log and warnings . However, it seems that my installation is missing this function:
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import logging >>> logging.captureWarnings Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'captureWarnings' >>> import logging.captureWarnings Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named captureWarnings >>> import warnings >>> import logging.captureWarnings Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named captureWarnings >>>
What am I doing wrong?
source share