Sometimes you want to silently log messages in :messages (i.e. place it in :messages without being displayed on screen) but it seems that currently there is no way to do it - though one can think to some not-so-nice workaround.
The obvious candidate for me should be echom, that is, silent echom "foo" does not display foo but it silently place it messages.
I am pretty sure that such a feature will come handy for many plugin authors.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
There is :unsilent and the help even gives an example use case (which does not help for your particular ask). However I'd argue, if you want the message be part of the message history, it should have - well - been messaged to the user first. Or else he won't know that he should look into the :messages list and assume everything went well, because Vim stayed silent.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Not necessarily. There are many use-case where you want to log some information without explicitly notifying the user.
For example, loggers work exactly in that way.
If you want to both notify user and log in :messages use echom, if you want to only notify the user without logging, use echo, if you want to log a message without notify the user use... nothing is in place today and silent echom seems to nicely fit here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This has been discussed and rejected in #12249
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I see. I thought that ch_log() only works with channels and jobs, but it can be used as a generic logger.
Nevertheless, if someone is interested in basic logging which is not necessarily connected to channels and jobs, it would be impossible to find it in the docs.
Also, an improvement could be to change the signature with:
ch_log({msg} [, {level}, {handle}])
Where level can be any of "debug", "info", "warning", "level", but that is another story. I may open a dedicated feature improvement issue if you believe the feature is worth (I believe it is).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()