logging问题错误解决:TypeError: not all arguments converted during string formatting

441 阅读1分钟

jsk learner

@[TOC](TypeError: not all arguments converted during string formatting)

问题描述

logging打印日志的时候,出现TypeError: not all arguments converted during string formatting错误。 在这里插入图片描述 xx_sample是一个字符串列表,按说没什么问题,但是确实是出现了这个问题。


问题解决

logger.info("defect_sample : ", defect_sample) 改为: logger.info("defect_sample={}".format(defect_sample))


2019.10.10 希望能帮到你。