-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
" Language: Erlang lager log files | ||
" Maintainer: Mr. Pi <[email protected]> | ||
" Last Change: 2013-11-10 | ||
" Version: 1.0.0-r1 | ||
|
||
if did_filetype() | ||
finish | ||
endif | ||
|
||
au BufNewFile,BufRead *.log if getline(1) =~ '^\d\{4}-\d\{2}-\d\{2} [0-9:]\{8}\.\d\{3} \(\[debug\]\|\[info\]\|\[notice\]\|\[warning\]\|\[error\]\|\[critical\]\|\[alert\]\|\[emergency\]\).*$' | setf lagerLog | endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
" Vim syntax file | ||
" Language: Erlang lager log files | ||
" Maintainer: Mr. Pi <[email protected]> | ||
" Last Change: 2013-11-10 | ||
" Version: 1.0.0-r1 | ||
|
||
if exists("b:current_syntax") | ||
finish | ||
else | ||
let b:current_syntax = "lagerLog" | ||
endif | ||
|
||
syn match erlangNode '\'[^']*@[^']*\'' | ||
syn match erlangModuleFunction '[^0-9 :@]\+:[^0-9 :/\()]\+/\d\+' | ||
syn match erlangModuleFunction '[^0-9 :@]\+:[^0-9 :/\()]\+([^()]*)' | ||
syn match lagerTimeStamp '^\d\{4}-\d\{2}-\d\{2} [0-9:]\{8}\.\d\{3} ' nextgroup=lagerSeverity | ||
syn match lagerSeverityDebug '\(\[debug\]\)' | ||
syn match lagerSeverityNormal '\(\[info\]\|\[notice\]\)' | ||
syn match lagerSeverityWarning '\(\[warning\]\)' | ||
syn match lagerSeverityError '\(\[error\]\)' | ||
syn match lagerSeverityCritical '\(\[critical\]\|\[alert\]\|\[emergency\]\)' | ||
syn match erlangPID '<\d\+\.\d\+\.\d\+>' | ||
syn match lagerAtModule '@[^:]*' nextgroup=lagerFunction | ||
syn match lagerFunction ':[^0-9 :]\+' nextgroup=lagerLineNumber | ||
syn match lagerLineNumber ':\d\+' | ||
|
||
hi lagerSeverityDebug term=bold cterm=bold ctermfg=gray | ||
hi lagerSeverityNormal term=bold,underline cterm=bold,underline ctermfg=white | ||
hi lagerSeverityWarning term=bold,underline cterm=bold,underline ctermfg=yellow | ||
hi lagerSeverityError term=bold,underline cterm=bold,underline ctermfg=gray ctermbg=red | ||
hi lagerSeverityCritical term=bold,underline cterm=bold,underline ctermfg=red ctermbg=gray | ||
|
||
hi def link erlangModuleFunction Function | ||
hi def link erlangNode Constant | ||
hi def link lagerTimeStamp Comment | ||
hi def link lagerSeverity Error | ||
hi def link erlangPID Label | ||
hi def link lagerAtModule Identifier | ||
hi def link lagerFunction Function | ||
hi def link lagerLineNumber Number |