更新时间:2023-11-16 22:27:52
在单元测试脚本中,放置
In your unit test script, place
import logging
logging.basicConfig(filename = log_filename, level = logging.DEBUG)
其中log_filename
是您想要将日志文件写入的位置的路径.
where log_filename
is a path to wherever you'd like the log file written to.
如果没有调用logging.basicConfig
或进行类似的调用来设置日志记录处理程序,则LOGGER.debug
命令将不执行任何操作.
Without the call to logging.basicConfig
or some such call to setup a logging handler, the LOGGER.debug
command does nothing.