问题描述
我的日志文件中包含以下几行
[18-09-2020-13:29:03:165 INFO] clicking on Gmail link on Google Home Page
[18-09-2020-13:29:05:297 DEBUG] Test_demo1.py:22:test_tc1: googlePage.py:13:func1: webActions.py:83:clickOnElement: => clicked on element : //a[text()='Gmail']
[18-09-2020-13:29:05:309 INFO] clicking on Sign in link on Gmail Home Page
[18-09-2020-13:29:07:562 DEBUG] Test_demo1.py:22:test_tc1: googlePage.py:19:func1: webActions.py:96:waitAndSendKeysOnElement: => entered text in element : //input[@id='identifierId']
[18-09-2020-13:29:07:642 DEBUG] Test_demo1.py:22:test_tc1: googlePage.py:20:func1: webActions.py:83:clickOnElement: => clicked on element : //div[@id='identifierNext']
[18-09-2020-13:29:18:059 ERROR] Exception occured in => Test_demo1.py:22:test_tc1: googlePage.py:21:func1: webActions.py:100:waitAndSendKeysOnElement:
[18-09-2020-13:29:18:060 ERROR] Unable to enter text in element : //input[@type='password']
[18-09-2020-13:29:18:061 ERROR] TimeoutException : Message:
我在PyCharm中添加了Ideolog插件,并使用以下内容
消息模式[\d{2}\-\d{2}\-\d{4}\-\d{2}:\d{2}:\d{2}:\d{3}\s([A-Z]{4,8})]\s(.*)$
消息开始模式^\[
时间格式d-m-Y-H:M:S
时间捕获组0
严重性捕获组0
类别捕获组0
模式
^\s*E(RROR)?\s*$
->高亮行(前景,#FF0000)
^\s*W(ARN(ING)?)?\s*$
->高亮行(前景,#FFAA00)
^\s*I(NFO)?\s*$
->高亮行(前景,#3FBF3F)
我仍然无法在日志文件中突出显示INFO和ERROR语句
有人可以让我知道如何正确配置消息模式以匹配我的日志文件以及如何使其突出显示吗?
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)