I'm attempting to add some debugging functionality to a small vim plugin that I am working on. I'd like to wrap
echom in a way that allows me to turn off output if I want.
I've attempted to do this:
function! s:log(...) if (get(g:, 'my_plugin_debug_setting', 0)) echom a:000 end endfunction :call s:log('Debugging information')
but that just logs the list
['Debugging information'] (which makes sense, since i've just done the equivalent of
I've also attempted to use
:call call('echo', a:000) but this doesn't work because echo is not a function.
Is there a way to do what I want?