add a simple debug message system

We may want to add debug messages at many points. We can add them as we
find we need them - i.e. when debugging stuff with users.
This commit is contained in:
Martin Grenfell 2013-04-13 16:51:23 +01:00
parent a7fcf4cad2
commit fbbb30295b
2 changed files with 14 additions and 0 deletions

View File

@ -92,6 +92,16 @@ function! syntastic#util#wideMsg(msg)
let &showcmd=old_showcmd
endfunction
if !exists("g:syntastic_debug")
let g:syntastic_debug = 0
endif
function! syntastic#util#debug(msg)
if g:syntastic_debug
echomsg "(Syntastic debug) - " . a:msg
endif
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -132,6 +132,8 @@ function! s:CacheErrors(...)
endif
for checker in checkers
call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.name())
let loclist = checker.getLocList()
if !loclist.isEmpty()
@ -257,6 +259,8 @@ endfunction
" 'defaults' - a dict containing default values for the returned errors
" 'subtype' - all errors will be assigned the given subtype
function! SyntasticMake(options)
call syntastic#util#debug('SyntasticMake: called with options: '. string(a:options))
let old_loclist = getloclist(0)
let old_makeprg = &l:makeprg
let old_shellpipe = &shellpipe