问题出现场景:
Traceback (most recent call last):
File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
msg = self.format(record)
File "/usr/lib64/python2.7/logging/__init__.py", line 724, in format
return fmt.format(record)
File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
record.message = record.getMessage()
File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file abc_request.py, line 175
log.logger.info(i['id'], i['state'])
解决办法:
log.logger.info(i['id'], i['state'])
log.logger.info(i['id'])
log.logger.info(i['state'])
log.logger.info(i['id'] + i['state'])
log.logger.info("%s,%s" % (i['id'], i['state']))