mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:20:05 +08:00
Improve logger
This commit is contained in:
parent
b84796485f
commit
bc7bbc4a11
14
.github/ISSUE_TEMPLATE.md
vendored
14
.github/ISSUE_TEMPLATE.md
vendored
@ -1,19 +1,15 @@
|
||||
### Expected behavior, english is recommend
|
||||
## Expected behavior, english is recommend
|
||||
|
||||
|
||||
### Environment Information
|
||||
## Environment Information
|
||||
- OS:
|
||||
- vim version:
|
||||
- neovim version:
|
||||
|
||||
### The reproduce ways from Vim starting (Required!)
|
||||
## The reproduce ways from Vim starting (Required!)
|
||||
|
||||
|
||||
### Output of the ":message" command, and ":echo SpaceVim#logger#viewLog()"
|
||||
## Output of the ":message" command, and ":echo SpaceVim#logger#viewLog()"
|
||||
|
||||
```log
|
||||
please post log here:
|
||||
please post log below, if you want me reproduce your issue quickly, post your custom config here will be better.
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
@ -0,0 +1,41 @@
|
||||
function! SpaceVim#health#python#check() abort
|
||||
let result = ['SpaceVim python support check report:']
|
||||
if has('nvim')
|
||||
call add(result, 'Checking +python3:')
|
||||
if has('python3')
|
||||
call add(result, ' SUCCEED!')
|
||||
else
|
||||
call add(result, ' Failed : to support +python3, you need run `pip3 install neovim`')
|
||||
endif
|
||||
call add(result, 'Checking +python:')
|
||||
if has('python')
|
||||
call add(result, ' SUCCEED!')
|
||||
else
|
||||
call add(result, ' Failed : to support +python, you need run `pip2 install neovim`')
|
||||
endif
|
||||
else
|
||||
call add(result, 'Checking +python3:')
|
||||
if has('python3')
|
||||
call add(result, ' SUCCEED!')
|
||||
else
|
||||
if !WINDOWS()
|
||||
call add(result, ' Failed : to support +python3, Please install vim-gik, or build from sources.')
|
||||
else
|
||||
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
|
||||
call add(result, ' install python3, make sure you have `python` in your path.')
|
||||
endif
|
||||
endif
|
||||
call add(result, 'Checking +python:')
|
||||
if has('python')
|
||||
call add(result, ' SUCCEED!')
|
||||
else
|
||||
if !WINDOWS()
|
||||
call add(result, ' Failed : to support +python, Please install vim-gik, or build from sources.')
|
||||
else
|
||||
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
|
||||
call add(result, ' install python3, make sure you have `python` in your path.')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return result
|
||||
endfunction
|
@ -47,19 +47,29 @@ endfunction
|
||||
|
||||
|
||||
function! SpaceVim#logger#viewLog(...) abort
|
||||
let info = "SpaceVim Options :\n\n"
|
||||
let info = "### SpaceVim Options :\n\n"
|
||||
let info .= "```viml\n"
|
||||
let info .= join(SpaceVim#options#list(), "\n")
|
||||
let info .= "\n"
|
||||
let info .= "\n```\n"
|
||||
let info .= "\n\n"
|
||||
|
||||
let info .= "### SpaceVim Health checking :\n\n"
|
||||
let info .= SpaceVim#health#report()
|
||||
let info .= "\n\n"
|
||||
|
||||
let info .= "### SpaceVim runtime log :\n\n"
|
||||
let info .= "```log\n"
|
||||
|
||||
let l = a:0 > 0 ? a:1 : 1
|
||||
if filereadable(s:logger_file)
|
||||
let logs = readfile(s:logger_file, '')
|
||||
return info . join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
|
||||
let info .= join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
|
||||
else
|
||||
let info .= '[ SpaceVim ] : logger file ' . s:logger_file . ' does not exists, only log for current process will be shown!'
|
||||
let info .= join(filter(s:log_temp, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n")
|
||||
return info
|
||||
endif
|
||||
let info .= "\n```\n"
|
||||
return info
|
||||
endfunction
|
||||
|
||||
""
|
||||
|
Loading…
Reference in New Issue
Block a user