连续循环登录 [英] logging in continouous loop
本文介绍了连续循环登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在不产生大量无用日志文件的情况下,在不断运行的循环中创建日志(使用python日志模块)的好方法是什么? 一个示例是一个循环,该循环常量列出一个文件夹,并在看到特定类型的文件时执行一些操作. 我要记录没有找到文件,或者找到文件但类型错误的日志,而不必为每个文件夹检查不断记录同一行,因为它可能每秒运行多次.
What would be a good way to create logs (with python logging module) inside a constant running loop, without producing a large amount of useless log-files? An example would be a loop that constant list a folder, and does some action when it sees a file of a specific type. I want to log that no files were found, or files were found but of a wrong type, without logging that same line constantly for each folder check, as it might run many times a second.
推荐答案
创建 查看全文