Skip to content

Instantly share code, notes, and snippets.

@gimre-xymcity
Created February 23, 2021 13:54
Show Gist options
  • Save gimre-xymcity/017b9ee81960d9939a8fd70fb5f8e0f4 to your computer and use it in GitHub Desktop.
Save gimre-xymcity/017b9ee81960d9939a8fd70fb5f8e0f4 to your computer and use it in GitHub Desktop.
" Vim syntax file
" Language: Catapult server log files
" Maintainer: gimre
" Latest Revision: 2020-12-10
" Changes: 2020-12-10 Initial version
" Based on messages.vim - syntax file for highlighting kernel messages
if exists("b:current_syntax")
finish
endif
syn match log_error '\c.*<\(FATAL\|ERROR\|ERRORS\|FAIL\|FAILED\|FAILURE\).*'
syn match log_warning '\c.*<\(WARNING\|DELETE\|DELETING\|DELETED\|RETRY\|RETRYING\).*'
syn match log_trace '\c.*<TRACE.*'
syn region log_string start=/'/ end=/'/ end=/$/ skip=/\\./
syn region log_string start=/"/ end=/"/ skip=/\\./
syn match log_hash '[0-9a-fA-F]\{32\}'
"syn match log_number '0x[0-9a-fA-F]*\|\[<[0-9a-f]\+>\]\|\<\d[0-9a-fA-F]*'
syn match log_date '\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) [ 0-9]\d *'
syn match log_date '\d\{4}-\d\d-\d\d'
syn match log_time '\d\d:\d\d:\d\d\(\.\d\+\)\?\s*'
syn match log_time '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
hi def link log_hash SpecialKey
hi def link log_string Special
hi def link log_date Ignore
hi def link log_time Ignore
hi def link log_error ErrorMsg
hi def link log_warning WarningMsg
hi def link log_trace Ignore
let b:current_syntax = "log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment