log.vim 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. if exists("b:current_syntax")
  2. finish
  3. endif
  4. "syn match log_error '\c.*\<\(FATAL\|ERROR\|ERRORS\|FAIL\|FAILED\|FAILURE\).*'
  5. syn match log_error ' \<\(FATAL\|ERROR\|ERRORS\|FAIL\|FAILED\|FAILURE\|SEVERE\).*'
  6. syn match log_warning '\c.*\<\(WARNING\|DELETE\|DELETING\|DELETED\|RETRY\|RETRYING\).*'
  7. syn region log_string start=/'/ end=/'/ end=/$/ skip=/\\./
  8. syn region log_string start=/"/ end=/"/ skip=/\\./
  9. syn match log_number '0x[0-9a-fA-F]*\|\[<[0-9a-f]\+>\]\|\<\d[0-9a-fA-F]*'
  10. syn match log_pkgname /\[.\{-2,}\] /
  11. syn match log_info /- .*/
  12. syn match log_date '\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) [ 0-9]\d *'
  13. syn match log_date '\d\{4}-\d\d-\d\d'
  14. syn match log_time '\d\d:\d\d:\d\d\s*'
  15. syn match log_time '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
  16. hi def link log_string String
  17. hi def link log_number Number
  18. hi def link log_date Constant
  19. hi def link log_time Type
  20. hi def link log_error ErrorMsg
  21. hi def link log_warning WarningMsg
  22. hi def link log_pkgname PreCondit
  23. hi def link log_info CursorLineNr
  24. syn match log_error_custom 'Caused by:.*'
  25. syn match log_error_custom 'java.lang.*Exception.*'
  26. syn match log_error_custom 'org.*Exception: .*'
  27. hi def link log_error_custom Cursor
  28. let b:current_syntax = "log"