I used the following code to register alerts:
import logging logging.captureWarnings(True) formatter = logging.Formatter('%(asctime)s\t%(levelname)s\t%(message)s') console_handler = logging.StreamHandler() console_handler.setLevel(logging.DEBUG) console_handler.setFormatter(formatter)
This works, however, my write formatter is not applied, and the warnings are as follows:
WARNING:py.warnings:/home/joakim/.virtualenvs/masterload/local/lib/python2.7/site-packages/MySQL_python-1.2.3c1-py2.7-linux-x86_64.egg/MySQLdb/cursors.py:100: Warning: InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
instead of the expected format:
2012-11-12 18:19:44,421 INFO START updating products
How can I apply standard formatting to recorded warning messages?
source share