我有一个生成日志文件的应用程序。我已经在python中编写了一个自动化脚本来运行该应用程序。如何将我的python自动化操作与日志文件中的条目相关联?我认为可以探索的一种方法是基于时间戳。
Python脚本
# script start time is 2019-01-29 15:59:59
enter_user_details()
login()
verify_login()
应用程序日志文件
2019-01-29 15:59:53,546 [24] INFO - StatusChanged: CONNECTING
2019-01-29 15:59:55,894 [25] INFO - [LOGIN]: User login
2019-01-29 15:59:55,894 [25] INFO - StatusChanged: DISCONNECTING
2019-01-29 15:59:59,738 [25] INFO - [LOGIN]: User logged out
2019-01-29 15:59:59,738 [25] INFO - StatusChanged: CONNECTING
2019-01-29 15:59:59,738 [1] INFO - [LOGIN]: User login
2019-01-29 15:59:59,738 [1] INFO - StatusChanged: DISCONNECTING
2019-01-29 15:59:59,748 [25] INFO - [LOGIN]: User logged out
2019-01-29 15:59:59,749 [1] INFO - StatusChanged: CONNECTING
2019-01-29 15:59:59,751 [1] INFO - [LOGIN]: User login
2019-01-29 15:59:59,755 [1] INFO - Disconnecting...