mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-14 10:45:42 +08:00
fix(mail): fix mail logger
This commit is contained in:
parent
5ec1b3beb5
commit
1cc4282c99
@ -12,7 +12,7 @@ function! mail#client#connect(ip, port)
|
||||
\ 'on_exit' : function('s:on_exit'),
|
||||
\ }
|
||||
\ )
|
||||
|
||||
call mail#client#logger#info('mail client job id:' . s:job_id)
|
||||
endfunction
|
||||
|
||||
" Wed, 06 Sep 2017 02:55:41 +0000 ===> 2017-09-06
|
||||
@ -61,6 +61,7 @@ function! s:parser(data) abort
|
||||
endfunction
|
||||
|
||||
function! s:on_stdout(id, data, event) abort
|
||||
call mail#client#logger#info('STDOUT: ' . string(a:data))
|
||||
call s:parser(a:data)
|
||||
endfunction
|
||||
|
||||
@ -84,7 +85,11 @@ endfunction
|
||||
|
||||
function! mail#client#send(command)
|
||||
call mail#client#logger#info('Send command: ' . a:command)
|
||||
if s:job_id >= 0
|
||||
call s:JOB.send(s:job_id, a:command)
|
||||
else
|
||||
call mail#client#logger#info('skipped!, job id is:' . s:job_id)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! mail#client#open()
|
||||
|
@ -1,11 +1,4 @@
|
||||
let s:LOGGER = SpaceVim#api#import('logger')
|
||||
|
||||
let g:wsd = keys(s:LOGGER)
|
||||
|
||||
call s:LOGGER.set_name('vim-mail')
|
||||
call s:LOGGER.set_level(1)
|
||||
let s:LOGGER.silent = 0
|
||||
|
||||
let s:LOGGER =SpaceVim#logger#derive('mail')
|
||||
|
||||
function! mail#client#logger#info(msg)
|
||||
call s:LOGGER.info(a:msg)
|
||||
@ -20,9 +13,3 @@ function! mail#client#logger#warn(msg)
|
||||
call s:LOGGER.warn(a:msg)
|
||||
|
||||
endfunction
|
||||
|
||||
function! mail#client#logger#view()
|
||||
|
||||
call s:LOGGER.view()
|
||||
|
||||
endfunction
|
||||
|
@ -4,13 +4,13 @@
|
||||
let s:BUFFER = SpaceVim#api#import('vim#buffer')
|
||||
|
||||
|
||||
let s:bufnr = 0
|
||||
let s:bufnr = -1
|
||||
let s:win_name = 'home'
|
||||
let s:win_dir = 'INBOX'
|
||||
let s:win_unseen = {}
|
||||
|
||||
function! mail#client#win#open()
|
||||
if s:bufnr == 0
|
||||
if s:bufnr ==# -1
|
||||
split __VIM_MAIL__
|
||||
let s:bufnr = bufnr('%')
|
||||
setlocal buftype=nofile nobuflisted nolist noswapfile nowrap cursorline nospell nomodifiable nowrap norelativenumber number
|
||||
|
16
bundle/vim-mail/autoload/mail/logger.vim
Normal file
16
bundle/vim-mail/autoload/mail/logger.vim
Normal file
@ -0,0 +1,16 @@
|
||||
let s:LOGGER =SpaceVim#logger#derive('vim-mail')
|
||||
|
||||
function! mail#logger#info(msg)
|
||||
call s:LOGGER.info(a:msg)
|
||||
endfunction
|
||||
|
||||
function! mail#logger#error(msg)
|
||||
call s:LOGGER.error(a:msg)
|
||||
endfunction
|
||||
|
||||
function! mail#logger#warn(msg)
|
||||
|
||||
call s:LOGGER.warn(a:msg)
|
||||
|
||||
endfunction
|
||||
|
Loading…
x
Reference in New Issue
Block a user