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