Debian Codegraph @

runtime/syntax/log.yaml

raw
1 filetype: log
2
3 detect:
4 filename: "(\\.log|log\\.txt)$"
5
6 rules:
7 - diff-modified: "\\b(WARN(ING)?|[Ww]arn(ing)?|w(r)?n|w|W/)\\b"
8 - diff-modified: "\\b(CRITICAL|[Cc]ritical)\\b"
9
10 - constant: "\\b(INFO(RMATION)?|[Ii]nfo(rmation)?|[Ii]n(f)?|i|I/)\\b"
11 - constant: "\\b(DEBUG|[Dd]ebug|dbug|dbg|de|d|D/)\\b"
12 - constant: "\\b(VERBOSE|[Vv]erbose|V/)\\b"
13 - constant: "\\b(ALERT|[Aa]lert)\\b"
14
15 - preproc: "\\b(TRACE|Trace|NOTICE|VERBOSE|verb|vrb|vb|v)\\b"
16
17 - gutter-error: "\\b(ERROR|[Ee]rr(or)?|[Ee]r(or)?|e|E\\x2F)\\b"
18 - gutter-error: "\\b(FATAL|[Ff]atal)\\b"
19 - gutter-error: "\\b(EMERGENCY|[Ee]mergency)\\b"
20 - gutter-error: "\\b(FAIL(URE)?|[Ff]ail(ure)?)\\b"
21
22 # constants
23 - constant.bool.true: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true)\\b"
24 - constant.bool.false: "\\b(NO|no|N|n|OFF|off|FALSE|False|false)\\b"
25 - constant.bool.false: "\\b(None|null|nil)\\b"
26
27 # numbers
28 - constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
29 - constant.number: "\\b0b(_?[01])+\\b" # bin
30 - constant.number: "\\b0o(_?[0-7])+\\b" # oct
31 - constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
32
33 # operators
34 - symbol.operator: "([~^.:;,+*|=!\\%]|<|>|/|-|&)"
35
36 # parentheses
37 - symbol.brackets: "([(){}]|\\[|\\])"
38
39 # string
40 - constant.string:
41 start: "\""
42 end: "(\"|$)"
43 skip: "\\\\."
44 rules:
45 - constant.specialChar: "\\\\."
46
47 - constant.string:
48 start: "'"
49 end: "('|$)"
50 skip: "\\\\."
51 rules:
52 - constant.specialChar: "\\\\."
53
54 # file
55 - preproc: "\\b(FILE|File|file)\\b"
56
57 # time
58 - identifier: "\\b((([Mm]on|[Tt]ues|[Ww]ed(nes)?|[Tt]hur(s)?|[Ff]ri|[Ss]at(ur)?|[Ss]un)(day)?\\s)?([Jj]an(uary)?|[Ff]eb(ruary)?|[Mm]ar(ch)?|[Aa]pr(il)?|[Mm]ay|[Jj]un(e)?|[Jj]ul(y)?|[Aa]ug(ust)?|[Aa]go|[Ss]ep(tember)?|[Oo]ct(ober)?|[Nn]ov(ember)?|[Dd]ec(ember)?)\\s\\d{1,2},?(\\s\\d{4})?)\\b" # date
59 - identifier: "\\b(\\d{2,4}[-/\\.]?\\d{2,3}[-/\\.]?\\d{2,4})\\b" # date
60 - identifier: "\\b(\\d{2}:\\d{2}(:\\d{2})?([\\.,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}?)?(\\s-\\d{0,4})?)\\b" # time
61 - identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9])"
62 # - identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9]\\s[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?(\\.?[0-9][0-9][0-9])?)"
63 - identifier: "^(\\d{4}[-/]?\\d{2}[-/]?\\d{2}\\s\\d{2}:\\d{2}(:\\d{2})?(\\.?\\d{2,8})?)"
64 - identifier: "^([0-2][0-9]|[0-2]-?[0-9][0-9]-?[0-9][0-9])\\-([0-1][0-9])\\-([0-3][0-9]) ([0-2][0-9])\\:([0-5][0-9])\\:([0-5][0-9]),([0-9][0-9][0-9])"
65 # Complete precision:
66 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))"
67 # No milliseconds:
68 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
69 # No Seconds:
70 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
71 # Putting it all together:
72 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
73 # Complete precision:
74 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)"
75 # No milliseconds
76 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)"
77 # No Seconds
78 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
79 # Putting it all together
80 - identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
81
82 # link
83 - constant.string.url:
84 start: "https?://"
85 end: "\\s"
86 rules: []
87
88 # path
89 # - constant.string.url: "\\b(.+)/([^/]+)\\b" # linux
90 # - constant.string.url: "\\b(^[a-zA-Z]:)\\b" # windowns
91
92 - diff-modified: "([Cc]ommit:)\\s\\w+\\[\\w+]"