![](/img/trans.png)
[英]How to output logging.info and logging.debug to console?
[英]how to pass multiple parameters in logging.info
我在日志記錄中傳遞參數
logging.info("the before and current time are",befot,curt)
但我得到錯誤
--- Logging error ---
TypeError: not all arguments converted during string formatting
您必須像下面這樣格式化日志:
logging.info("之前和當前時間是{}".format(befot)+' {}'.format(curt))
logging.info(f"the before and current time are {befot} {curt}")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.