attempt to fix syslog error highlighting

This commit is contained in:
Keith Hall 2025-02-08 21:06:33 +02:00
parent ac40f7cfd8
commit b82b920420
3 changed files with 29 additions and 26 deletions

View File

@ -38,21 +38,21 @@ contexts:
scope: markup.underline.link.scheme.log
push: url-host
log_level_lines:
- match: ^(?=.*{{error}})
- match: (?=.*{{error}})
push:
- error_line
- error_line_meta
- main_pop_at_eol
- match: ^(?=.*{{warning}})
- match: (?=.*{{warning}})
push:
- warning_line
- warning_line_meta
- main_pop_at_eol
- match: ^(?=.*{{info}})
- match: (?=.*{{info}})
push:
- info_line
- info_line_meta
- main_pop_at_eol
- match: ^(?=.*{{debug}})
- match: (?=.*{{debug}})
push:
- debug_line
- debug_line_meta
- main_pop_at_eol
log_levels:
- match: '{{error}}'
@ -63,16 +63,16 @@ contexts:
scope: markup.info.log
- match: '{{debug}}'
scope: markup.info.log
error_line:
error_line_meta:
- meta_scope: meta.annotation.error-line.log
- include: immediately_pop
warning_line:
warning_line_meta:
- meta_scope: meta.annotation.warning-line.log
- include: immediately_pop
info_line:
info_line_meta:
- meta_scope: meta.annotation.info-line.log
- include: immediately_pop
debug_line:
debug_line_meta:
- meta_scope: meta.annotation.debug-line.log
- include: immediately_pop
immediately_pop:

View File

@ -31,22 +31,24 @@ contexts:
structured-data:
- match: '\['
scope: punctuation.section.mapping.begin.syslog
push:
- match: \]
scope: punctuation.section.mapping.end.syslog
pop: true
- match: \w+
scope: variable.parameter.syslog
- match: =
scope: keyword.operator.assignment.syslog
push:
- match: '[^\s\]]+'
scope: constant.other.syslog
pop: true
- match: (?=\])
pop: true
push: structured-data-contents
- match: (?=\S)
set: text
structured-data-contents:
- match: \]
scope: punctuation.section.mapping.end.syslog
pop: true
- match: \w+
scope: variable.parameter.syslog
- match: =
scope: keyword.operator.assignment.syslog
push: structured-data-assignment
structured-data-assignment:
- match: '[^\s\]]+'
scope: constant.other.syslog
pop: true
- match: (?=\])
pop: true
text:
- match: $
pop: true

View File

@ -14,3 +14,4 @@ Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epol
Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
Aug 11 21:40:31 hostname-here scop hello
Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
2025-02-08 20:52:11.039 - setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version