mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:40:05 +08:00
Fix logger
This commit is contained in:
parent
9ac9f8fbad
commit
58b3685c50
@ -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
|
||||
|
||||
|
7
autoload/SpaceVim/options.vim
Normal file
7
autoload/SpaceVim/options.vim
Normal 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
|
Loading…
Reference in New Issue
Block a user