1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language
[
<!ENTITY datetime "(?:(?:.\[)?(?:\d{1,2};){2}\d{1,3}m\s*)?(?:(?:\d{4}\-)?\d{2}\-\d{2}\s\d{2}(?:\:\d{2}){2}\.\d{3,6}(?:\s[\-\+]\d{4})?|\d+\.\d{3,6})\:?">
<!ENTITY priority_tag "(?:[/\s][^:\(]*(?:\([^\)]+\))?:|\([^\)]+\):?)"> <!-- Tag/PID/Threads -->
<!ENTITY delim "[/\(\s]"> <!-- Delimiter between priority and tag -->
]>
<!--
Logcat Syntax Highlighting Definition
===========================================================================
This file is part of the KDE's KSyntaxHighlighting framework.
SPDX-FileCopyrightText: 2018-2020 Nibaldo González S. <nibgonz@gmail.com>
SPDX-License-Identifier: MIT
===========================================================================
Last update: September 30, 2020 (v6)
-->
<language name="Logcat"
version="9"
kateversion="5.0"
section="Other"
extensions="*.logcat"
mimetype="text/x-logcat"
priority="5"
author="Nibaldo González (nibgonz@gmail.com)"
license="MIT">
<highlighting>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<DetectChar context="CommentLine" attribute="Comment" char="#" firstNonSpace="true" />
<StringDetect context="CommentLine" attribute="Comment" String="---------" firstNonSpace="true" />
<RegExpr context="#stay" attribute="Comment" String="^\*\s.+\s\*$" column="0" />
<RegExpr context="#stay" attribute="DateTime" String="&datetime;" firstNonSpace="true" />
<!-- Priority & Tag -->
<RegExpr context="VerboseMsg" attribute="Verbose Tag" String="(?:^|\s)[V\?](?:&priority_tag;|(?=&delim;))" />
<RegExpr context="DebugMsg" attribute="Debug Tag" String="(?:^|\s)D(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="InfoMsg" attribute="Info Tag" String="(?:^|\s)I(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="WarningMsg" attribute="Warning Tag" String="(?:^|\s)W(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="AssertMsg" attribute="Assert Tag" String="(?:^|\s)A(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="SilentMsg" attribute="Silent Tag" String="(?:^|\s)S(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="ErrorMsg" attribute="Error Tag" String="(?:^|\s)E(?:&priority_tag;|(?=&delim;))" />
<RegExpr context="#stay" attribute="Error Tag" String="\sF&delim;.*\033\[\d{1,3}m$" />
<RegExpr context="FatalMsg" attribute="Fatal" String="^F&delim;" column="0" />
<RegExpr context="FatalMsg" attribute="Normal Text" String="\s(?=F&delim;)" />
<!-- For "-v long" -->
<DetectChar context="LongLog" attribute="Normal Text" char="[" column="0" />
</context>
<context name="CommentLine" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Comments" />
</context>
<context name="VerboseMsg" attribute="Verbose Message" lineEndContext="#pop" />
<context name="DebugMsg" attribute="Debug Message" lineEndContext="#pop" />
<context name="InfoMsg" attribute="Info Message" lineEndContext="#pop" />
<context name="WarningMsg" attribute="Warning Message" lineEndContext="#pop" />
<context name="AssertMsg" attribute="Assert Message" lineEndContext="#pop" />
<context name="SilentMsg" attribute="Silent Message" lineEndContext="#pop" />
<context name="ErrorMsg" attribute="Error Message" lineEndContext="#pop" />
<context name="FatalMsg" attribute="Fatal" lineEndContext="#pop" />
<!-- Long Format -->
<context name="LongLog" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr context="#pop!LongLogTag" attribute="DateTime" String="\s+&datetime;(?=\s.+\s\]$)" />
</context>
<context name="LongLogTag" attribute="Normal Text" lineEndContext="#pop">
<RegExpr context="#pop!LongLogVerbose" attribute="Verbose Tag" String="\s[V\?]&delim;" />
<RegExpr context="#pop!LongLogDebug" attribute="Debug Tag" String="\sD&delim;" />
<RegExpr context="#pop!LongLogInfo" attribute="Info Tag" String="\sI&delim;" />
<RegExpr context="#pop!LongLogWarning" attribute="Warning Tag" String="\sW&delim;" />
<RegExpr context="#pop!LongLogAssert" attribute="Assert Tag" String="\sA&delim;" />
<RegExpr context="#pop!LongLogSilent" attribute="Silent Tag" String="\sS&delim;" />
<RegExpr context="#pop!LongLogError" attribute="Error Tag" String="\sE&delim;" />
<RegExpr context="#pop!LongLogFatal" attribute="Normal Text" String="\s(?=F&delim;)" />
</context>
<context name="LongLogVerbose" attribute="Verbose Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogVerboseMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogDebug" attribute="Debug Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogDebugMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogInfo" attribute="Info Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogInfoMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogWarning" attribute="Warning Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogWarningMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogAssert" attribute="Assert Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogAssertMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogSilent" attribute="Silent Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogSilentMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogError" attribute="Error Tag" lineEndContext="#pop">
<LineContinue context="#pop!LongLogErrorMsg" attribute="Normal Text" char="]" />
</context>
<context name="LongLogFatal" attribute="Fatal" lineEndContext="#pop">
<RegExpr context="#pop!LongLogFatalMsg" attribute="Normal Text" String="\s*\]$" />
</context>
<context name="LongLogVerboseMsg" attribute="Verbose Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogDebugMsg" attribute="Debug Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogInfoMsg" attribute="Info Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogWarningMsg" attribute="Warning Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogAssertMsg" attribute="Assert Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogSilentMsg" attribute="Silent Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogErrorMsg" attribute="Error Message" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="LongLogFatalMsg" attribute="Fatal" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<IncludeRules context="DefaultLongLogMsg" />
</context>
<context name="DefaultLongLogMsg" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="EmptyLine">
<StringDetect context="#pop!CommentLine" attribute="Comment" String="---------" firstNonSpace="true" />
<RegExpr context="#pop" attribute="Comment" String="^\*\s.+\s\*$" column="0" />
<RegExpr context="#pop!LongLog" attribute="Normal Text" String="^\[(?=\s+&datetime;\s.+\s\]$)" column="0" />
<RegExpr context="EmptyLine" attribute="Normal Text" String="^\s*$" column="0" />
</context>
<context name="EmptyLine" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectChar context="#pop#pop!CommentLine" attribute="Comment" char="#" firstNonSpace="true" />
<RegExpr context="#pop#pop!LongLog" attribute="Normal Text" String="^\[(?=\s.+\s\]$)" column="0" />
<!-- In a normal Log this is not necessary, but probably some people put items of Logs
of different formats in a single file. -->
<RegExpr context="#pop#pop" attribute="DateTime" String="&datetime;" firstNonSpace="true" />
<!-- NOTE: Use "^\s*" with lookAhead, not firstNonSpace -->
<RegExpr context="#pop#pop" attribute="Normal Text" String="^\s*[VDIWASEF\?]&priority_tag;" column="0" lookAhead="true" minimal="1" />
<DetectSpaces />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" />
<itemData name="Comment" defStyleNum="dsComment" italic="1" />
<itemData name="DateTime" defStyleNum="dsComment" italic="0" underline="0" spellChecking="false" />
<itemData name="Verbose Tag" defStyleNum="dsNormal" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Verbose Message" defStyleNum="dsNormal" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Debug Tag" defStyleNum="dsAttribute" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Debug Message" defStyleNum="dsAttribute" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Info Tag" defStyleNum="dsPreprocessor" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Info Message" defStyleNum="dsPreprocessor" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Warning Tag" defStyleNum="dsInformation" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Warning Message" defStyleNum="dsInformation" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Assert Tag" defStyleNum="dsChar" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Assert Message" defStyleNum="dsChar" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Silent Tag" defStyleNum="dsBuiltIn" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Silent Message" defStyleNum="dsBuiltIn" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Error Tag" defStyleNum="dsError" bold="1" italic="0" underline="0" strikeOut="0" />
<itemData name="Error Message" defStyleNum="dsError" bold="0" italic="0" underline="0" strikeOut="0" />
<itemData name="Fatal" defStyleNum="dsAlert" bold="1" italic="0" underline="0" strikeOut="0" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" />
</comments>
<emptyLines>
<emptyLine regexpr="\s+"/>
</emptyLines>
</general>
</language>
<!-- kate: replace-tabs off; remove-trailing-spaces mod; dynamic-word-wrap off; -->
|