Python: Logging TypeError: not all arguments converted during string formatting
问题 Here is what I am doing >>> import logging >>> logging.getLogger().setLevel(logging.INFO) >>> from datetime import date >>> date = date.today() >>> logging.info('date={}', date) Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 846, in emit msg = self.format(record) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 723, in format return fmt