1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-03-21 18:18:31 +00:00

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

View File

@ -31,22 +31,24 @@ contexts:
structured-data: structured-data:
- match: '\[' - match: '\['
scope: punctuation.section.mapping.begin.syslog scope: punctuation.section.mapping.begin.syslog
push: push: 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:
- match: '[^\s\]]+'
scope: constant.other.syslog
pop: true
- match: (?=\])
pop: true
- match: (?=\S) - match: (?=\S)
set: text 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: text:
- match: $ - match: $
pop: true 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: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 11 21:40:31 hostname-here scop hello
Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories. 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