PythonLoggingNotesLogBook
发布时间
阅读量:
阅读量
import logging
import os
logging.basicConfig(
format='[%(asctime)s] %(message)s', # format 和 datefmt都要有。
datefmt='%Y/%M/%d %H:%M:%S',
level=logging.DEBUG,
handlers=[
logging.FileHandler(os.path.join('/home/you/you/chenwei/AdelaiDet/adet/modeling/MEInst/Decouple/', 'eval.log')),
logging.StreamHandler()
]
)
logging.info("test for beginning")
logging.info("test ok")
# output:
[2021/3
全部评论 (0)
还没有任何评论哟~
