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

Fix logger

This commit is contained in:
wsdjeg 2017-01-24 00:16:35 +08:00
parent 9ac9f8fbad
commit 58b3685c50
2 changed files with 13 additions and 2 deletions

View File

@ -40,12 +40,16 @@ endfunction
function! SpaceVim#logger#viewLog(...) abort
let info = "SpaceVim Options :\n\n"
let info .= join(SpaceVim#options#list(), "\n")
let info .= "\n"
let l = a:0 > 0 ? a:1 : 1
if filereadable(s:logger_file)
let logs = readfile(s:logger_file, '')
return join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
return info . join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
else
return '[ SpaceVim ] : logger file ' . s:logger_file . ' does not exists!'
return info . '[ SpaceVim ] : logger file ' . s:logger_file . ' does not exists!'
endif
endfunction

View File

@ -0,0 +1,7 @@
function! SpaceVim#options#list() abort
let list = []
for var in getcompletion('g:spacevim_','var')
call add(list, var . " = " . string(get(g:, var[2:] , '')))
endfor
return list
endfunction