Open Acheng97 opened 2 months ago
Both scripts are written to the same log file, and the same log is written twice. Only if script a calls script b and passes the log file created in a as a parameter to script b, will the same log not be written twice
Hi.
You likely need to call logger.remove()
first. Also, make sure logger.add()
is only called once (to be put inside a if __name__ == "__main__"
block for example).
只有a脚本调用b脚本,把a中创建的日志文件当作参数传入b脚本,才不会出现同一条日志写入两遍的情况