1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:10:04 +08:00

fix(logger): fix derived logger

This commit is contained in:
wsdjeg 2023-04-03 12:52:27 +08:00
parent 02fadf00ff
commit de6efc650c
4 changed files with 11 additions and 7 deletions

View File

@ -234,6 +234,10 @@ else
let self._debug_mode = 0
endfunction
function! s:derive.debug_enabled() abort
return self._debug_mode
endfunction
function! SpaceVim#logger#derive(name) abort
let s:derive.derive_name = printf('%' . strdisplaywidth(s:LOGGER.get_name()) . 'S', a:name)
return deepcopy(s:derive)

View File

@ -1278,7 +1278,7 @@ function! s:ProcessFile(fname, ftype) abort
let ctags_output = s:ExecuteCtagsOnFile(tempfile, a:fname, typeinfo)
if !tagbar#log#enabled()
if !tagbar#log#debug_enabled()
call delete(tempfile)
endif
else
@ -1404,7 +1404,7 @@ function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
\ ]
" verbose if debug enabled
if tagbar#log#enabled()
if tagbar#log#debug_enabled()
let ctags_args += [ '-V' ]
endif
@ -3155,7 +3155,7 @@ function! s:ExecuteCtags(ctags_cmd) abort
set shellcmdflag=/s\ /c
endif
if tagbar#log#enabled()
if tagbar#log#debug_enabled()
silent 5verbose let ctags_output = system(a:ctags_cmd)
call tagbar#log#debug(v:statusmsg)
call tagbar#log#debug('Exit code: ' . v:shell_error)
@ -4052,7 +4052,7 @@ endfunction
" tagbar#printfileinfo() {{{2
function! tagbar#printfileinfo() abort
if !tagbar#log#enabled()
if !tagbar#log#debug_enabled()
echo 'Tagbar debug is disabled - unable to print fileinfo to tagbar log'
return
endif

View File

@ -30,6 +30,6 @@ function! tagbar#log#info(msg) abort
call s:LOGGER.info(a:msg)
endfunction
function! tagbar#log#enabled() abort
return s:LOGGER.enabled()
function! tagbar#log#debug_enabled() abort
return s:LOGGER.debug_enabled()
endfunction

View File

@ -139,7 +139,7 @@ function M.derive(name)
function derive.stop_debug()
derive._debug_mode = false
end
function derive.enabled() -- {{{
function derive.debug_enabled() -- {{{
return derive._debug_mode
end
-- }}}