mirror of
https://github.com/sharkdp/bat
synced 2026-08-26 14:13:37 +01:00
fix(syntax): preserve log-level scopes in Syslog
This commit is contained in:
+18
@@ -55,6 +55,24 @@ contexts:
|
|||||||
push:
|
push:
|
||||||
- debug_line_meta
|
- debug_line_meta
|
||||||
- main_pop_at_eol
|
- main_pop_at_eol
|
||||||
|
# For syntaxes that embed Log after consuming a prefix. Call this context once.
|
||||||
|
log_level_lines_at_current_position:
|
||||||
|
- match: (?=.*{{error}})
|
||||||
|
set:
|
||||||
|
- error_line_meta
|
||||||
|
- main_pop_at_eol
|
||||||
|
- match: (?=.*{{warning}})
|
||||||
|
set:
|
||||||
|
- warning_line_meta
|
||||||
|
- main_pop_at_eol
|
||||||
|
- match: (?=.*{{info}})
|
||||||
|
set:
|
||||||
|
- info_line_meta
|
||||||
|
- main_pop_at_eol
|
||||||
|
- match: (?=.*{{debug}})
|
||||||
|
set:
|
||||||
|
- debug_line_meta
|
||||||
|
- main_pop_at_eol
|
||||||
log_levels:
|
log_levels:
|
||||||
- match: '{{error}}'
|
- match: '{{error}}'
|
||||||
scope: markup.error.log
|
scope: markup.error.log
|
||||||
|
|||||||
+11
-1
@@ -50,6 +50,17 @@ contexts:
|
|||||||
- match: (?=\])
|
- match: (?=\])
|
||||||
pop: true
|
pop: true
|
||||||
text:
|
text:
|
||||||
|
- include: text_special
|
||||||
|
- match: ''
|
||||||
|
set: classify_log_text
|
||||||
|
classify_log_text:
|
||||||
|
- include: scope:text.log#log_level_lines_at_current_position
|
||||||
|
- match: ''
|
||||||
|
set: text_body
|
||||||
|
text_body:
|
||||||
|
- include: text_special
|
||||||
|
- include: scope:text.log
|
||||||
|
text_special:
|
||||||
- match: $
|
- match: $
|
||||||
pop: true
|
pop: true
|
||||||
- match: '<\w+>'
|
- match: '<\w+>'
|
||||||
@@ -62,4 +73,3 @@ contexts:
|
|||||||
escape: \)$
|
escape: \)$
|
||||||
escape_captures:
|
escape_captures:
|
||||||
0: punctuation.section.block.end.syslog
|
0: punctuation.section.block.end.syslog
|
||||||
- include: scope:text.log
|
|
||||||
|
|||||||
Reference in New Issue
Block a user