Closed saidelike closed 3 months ago
I believe the culprit logging is https://github.com/neovim/node-client/blob/e03e409a5e61713259148cb5f83e1b85420a9343/packages/neovim/src/api/client.ts#L70
logger.info
never writes to stdio unless you set ALLOW_CONSOLE
.
What are the exact, minimal steps to reproduce the issue?
Yes I can confirm it only happens when ALLOW_CONSOLE=1
. Without it, it does not trigger. I don't need it for remote plugins so it is not blocking for me. I only had it enabled because I tested the demo example previously.
To reproduce the issue, set ALLOW_CONSOLE=1
, create an empty remote plugin, load it and let logger.info
being called which will write onto stdout. Maybe it is expected but it should probably be documented. Especially because it crashes node.exe https://github.com/neovim/node-client/issues/343
ALLOW_CONSOLE=1
by definition will break a RPC channel because the "console" is stdout, which is also the RPC channel.
It's documented at https://github.com/neovim/node-client?tab=readme-ov-file#logging but I'll make it clearer.
node-client: 5.1.0 nvim: nvim-win64-0.9.5-RelWithDebInfo-LuaJIT-2.1.1703942320.msi
Creating a new issue different from https://github.com/neovim/node-client/issues/329 because now it effectively logs in the log file, but it also crashes neovim still. Just to be clear with the previous issue, it wouldn't log properly as I would get
{"level":"info","message":"handleRequest: "}
instead of2024-03-26 10:06:42 INF handleRequest:
.note that this is testing with a remote plugin.
and the log file: