From 8a139e05765a8514db5bb3985cbb87f04ec2158f Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Fri, 4 Apr 2014 00:31:27 +1300 Subject: [PATCH] Better timestamps --- autoload/tagbar.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 56e4d80..c5d9087 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -3891,10 +3891,20 @@ function! s:StopDebug() abort endfunction " s:LogDebugMessage() {{{2 +if has('reltime') + function! s:gettime() abort + let time = split(reltimestr(reltime()), '\.') + return strftime('%Y-%m-%d %H:%M:%S.', time[0]) . time[1] + endfunction +else + function! s:gettime() abort + return strftime('%Y-%m-%d %H:%M:%S') + endfunction +endif function! s:LogDebugMessage(msg) abort if s:debug execute 'redir >> ' . s:debug_file - silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n" + silent echon s:gettime() . ': ' . a:msg . "\n" redir END endif endfunction