是否可以将带有end ='\ r'标志的格式化字符串传递给记录器? 以前我曾经有一条print()语句,我用logging.info()代替了它,但是现在它停止了工作
import logging
logging.basicConfig(level=logging.DEBUG)
logging.info("Running operation ID: {0} on {1}. fl-queuetool -z {1} log {0}".format(str(oper_ID), zone))
while True:
stat = getOperationStatus(zone, oper_ID)
logging.info(stat, end='\r')
端子输出:
INFO:root:Running operation ID: 6057 on star. fl-queuetool -z star log 6057
DEBUG:root:_log() got an unexpected keyword argument 'end'
是否有解决方法?它在文档中读取该函数接受* args ...
logging.info(msg, *args, **kwargs)¶
Logs a message with level INFO on the root logger. The arguments are interpreted as for debug().