日志注释
locom的Python项目详细描述
地点
Locom是首字母缩略词logcomments。 它旨在帮助进行日志分析。在
如果您是测试人员或系统分析员,则需要经常查看日志。 记笔记或突出一些行通常很有用。 如果日志来自复杂的系统,与其他人分享您的评论会很有用。 它应该保存在一些常用的日志格式。 这正是这个工具的用途。在
安装
pipinstalllocom
工作原理
- 在
Getlog file,需要对其进行注释。在
在 - 在
创建rules file,该文件描述行的注释和突出显示。在
在 - 在
在命令行中运行locom。在
在 - 在
获取带有注释和突出显示的日志的html版本。在
在
示例
这个例子放在example directory。在
日志:输入文件
^{pr2}$规则文件:规则.txt
re Brno red red comment
re Prague green green comment
re Bratislava blue blue comment
re Vienna yellow yellow comment
row 9 gray gray comment
row 11 violet violet comment
re Paris low low row and comment
re Stockholm normal normal row and comment
re Madrid hide
CLI
locom cli -r rules.txt -i input.txt -o output_example.html --title "Example of rows and comments" --description "This example shows all possible type of rows and comments."
注意:使用的Python路径中必须有/Scripts。在
输出HTML:输出_示例.html
缺少第17行不是错误。它是hide呈现的结果。在
规则文件
文件中的一行是一条规则。每个规则有3个强制性部分和1个可选部分。部分由4+个空格分隔。在
考虑这个带有命名部件的示例。在
re Brno red red comment
[row recognizer type] [recognizer value] [render type] [comment - optional]
识别器
实现了两种类型的识别器:
- 在
re-Recognizer value是此类型识别器的正则表达式。在
在 - 在
row-Recognizer value是此类识别器的行号。在
在
渲染
所有渲染的列表:
- 红色
- 绿色
- 蓝色
- 黄色
- 灰色
- 紫罗兰色
- 低
- 正常
- 隐藏
- 项目
标签: