Best way to highlight json logs #2732
-
I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This isn't really possible without editing the syntax definition, which is basically just a YAML file with regex patterns. https://github.com/sharkdp/bat/blob/master/assets/syntaxes/02_Extra/log.sublime-syntax. Likely you'd want to add a new If you can share some example log lines, I might be able to spare some time to work on it at some point. |
Beta Was this translation helpful? Give feedback.
This isn't really possible without editing the syntax definition, which is basically just a YAML file with regex patterns. https://github.com/sharkdp/bat/blob/master/assets/syntaxes/02_Extra/log.sublime-syntax.
Likely you'd want to add a new
- match
to themain_without_log_level_line
context to look for{
andembed
the JSON syntax and pop at EOL.You should be able to experiment by copying the
log.sublime-syntax
file to your bat config folder and following the instructions https://github.com/sharkdp/bat/tree/master#adding-new-syntaxes--language-definitionsIf you can share some example log lines, I might be able to spare some time to work on it at some point.