当前位置: 首页 > article >正文

Notepad++通过自定义语言实现日志按照不同级别高亮

借助Notepad++的自定义语言可以实现日志的按照不同级别的高亮;
参考: https://blog.csdn.net/commshare/article/details/131208656
在此基础上做了一点修改效果如下:
在这里插入图片描述
xml文件:

<NotepadPlus>
    <UserLang name="Ansible" ext="" udlVersion="2.1">
        <Settings>
            <Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
            <Prefix Keywords1="yes" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments">00Traceback 00ArithmeticError 00AssertionError 00AttributeError 00BaseException 00BlockingIOError 00BrokenPipeError 00BufferError 00ChildProcessError 00ConnectionAbortedError 00ConnectionError 00ConnectionRefusedError 00ConnectionResetError 00EOFError 00EnvironmentError 00Exception 00FileExistsError 00FileNotFoundError 00FloatingPointError 00GeneratorExit 00IOError 00ImportError 00IndentationError 00IndexError 00InterruptedError 00IsADirectoryError 00KeyError 00KeyboardInterrupt 00LookupError 00MemoryError 00ModuleNotFoundError 00NameError 00NotADirectoryError 00NotImplemented 00NotImplementedError 00OSError 00OverflowError 00PermissionError 00ProcessLookupError 00RecursionError 00ReferenceError 00RuntimeError 00StopAsyncIteration 00StopIteration 00SyntaxError 00SystemError 00SystemExit 00TabError 00TimeoutError 00TypeError 00UnboundLocalError 00UnicodeDecodeError 00UnicodeEncodeError 00UnicodeError 00UnicodeTranslateError 00ValueError 00WindowsError 00ZeroDivisionError</Keywords>
            <Keywords name="Numbers">1 2 3 4 5 6 7 8 9 0</Keywords>
            <Keywords name="Numbers, prefix2"></Keywords>
            <Keywords name="Numbers, extras1"></Keywords>
            <Keywords name="Numbers, extras2"></Keywords>
            <Keywords name="Numbers, suffix1"></Keywords>
            <Keywords name="Numbers, suffix2"></Keywords>
            <Keywords name="Numbers, range"></Keywords>
            <Keywords name="Operators1"></Keywords>
            <Keywords name="Operators2"></Keywords>
            <Keywords name="Folders in code1, open"></Keywords>
            <Keywords name="Folders in code1, middle"></Keywords>
            <Keywords name="Folders in code1, close"></Keywords>
            <Keywords name="Folders in code2, open"></Keywords>
            <Keywords name="Folders in code2, middle"></Keywords>
            <Keywords name="Folders in code2, close"></Keywords>
            <Keywords name="Folders in comment, open"></Keywords>
            <Keywords name="Folders in comment, middle"></Keywords>
            <Keywords name="Folders in comment, close"></Keywords>
            <Keywords name="Keywords1">ok success successfully enable changed</Keywords>
            <Keywords name="Keywords2">fail failed disable</Keywords>
            <Keywords name="Keywords3"></Keywords>
            <Keywords name="Keywords4"></Keywords>
            <Keywords name="Keywords5"></Keywords>
            <Keywords name="Keywords6"></Keywords>
            <Keywords name="Keywords7"></Keywords>
            <Keywords name="Keywords8"></Keywords>
            <Keywords name="Delimiters">00trace 01 02&#x000A; 03debug 04 05&#x000A; 06info 07 08&#x000A; 09warn 10 11&#x000A; 12warning 13 14&#x000A; 15error 16 17&#x000A; 18CRITICAL 18 20&#x000A; 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" colorStyle="0" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="FF80FF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="FF0000" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="60FF8F" bgColor="FFFFFF" colorStyle="0" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="339933" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="ff3333" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="999999" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="6699cc" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" fgColor="339933" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="ff9933" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="ff9933" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="ff3333" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
			<WordsStyle name="DELIMITERS7" fgColor="ff3333" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS9" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
        </Styles>
    </UserLang>
</NotepadPlus>


http://www.kler.cn/news/364954.html

相关文章:

  • Spring-boot vue项目部署
  • 操作系统期末|考研复习知识点汇总 - 持续更新
  • 信息安全工程师(67)网络流量清洗技术与应用
  • 基于HEC-Ras及ArcGIS的泥石流数值模拟与灾害风险评估典型案例
  • 位运算挑战:通过最少位翻转实现 a OR b == c【逐位处理与右移操作】
  • Pandas模块之垂直或水平交错条形图
  • AI写PPT工具:四款人工智能软件全面解析!!
  • 5G超级上行,到底有多行?
  • Spring Boot在线考试系统:JavaWeb技术的最佳实践
  • vue文件报Cannot find module ‘webpack/lib/RuleSet‘错误处理
  • 3.cpp基本数据类型
  • 设计模式(二)工厂模式详解
  • 数据结构_day3
  • 在Spring中,什么是配置类
  • 【C语言】自定义类型:结构体(下)
  • 《首尔破笑组:在欢笑中触摸生活的温度》
  • 给已经写好的裸机程序移植freeRTOS操作系统(二)
  • 6.Three.js贴图与uv映射(uv坐标)理解和实践
  • 鸿蒙应用示例:仿钉钉日历新建日程
  • C语言中的分支与循环(中 1)
  • Java中的基本数据类型和引用类型存储在JVM中那个区域?
  • 缓存池(对象池)使用
  • 现代山东比较出名的人物颜廷利:以塑造智慧为荣,以失去素质为耻
  • MATLAB Simulink (一)直接序列扩频通信系统
  • 深入理解 RabbitMQ 及在.NET 中的应用
  • 碰一碰发视频源码开发,矩阵短视频新模式,支持OEM