TypeError: not enough arguments for format string


Error msg:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 993, in emit
    msg = self.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 839, in format
    return fmt.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 579, in format
    s = self.formatMessage(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 548, in formatMessage
    return self._style.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 391, in format
    return self._fmt % record.__dict__
TypeError: not enough arguments for format string
Call stack:
  File "start.py", line 7, in <module>
    Engine().start()
  File "/home/hpcm/Desktop/spider/13-frame_spider/myscrapy/core/engine.py", line 45, in start
    logger.info("End time is [ {} ]".format(end))
Message: 'End time is [ 2018-09-27 17:55:54.795786 ]'
Arguments: ()

问题:

  setting中的log使用的DEFAULT_LOG_FMT参数出错

解决:

  检查参数是否写错, 或者多项少项


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM