Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两个脚本写进同一个日志文件,同一条日志会写入两遍 #1204

Open
Acheng97 opened this issue Sep 13, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@Acheng97
Copy link

只有a脚本调用b脚本,把a中创建的日志文件当作参数传入b脚本,才不会出现同一条日志写入两遍的情况

@Delgan
Copy link
Owner

Delgan commented Sep 22, 2024

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).

@Delgan Delgan added the question Further information is requested label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants