【发布时间】:2016-04-29 08:10:51
【问题描述】:
我的一个logger.debug() 语句需要相当费力的输入。
我知道我应该做logger.debug("The spam is %s", spam_temperature) 而不是logger.debug("The spam is {}".format(spam_temperature))。问题是我需要执行以实际找出spam_temperature 的操作非常消耗CPU,如果日志级别是INFO,我对它们没有用处。
在这种情况下,最佳做法是什么?
【问题讨论】: