[英]How do I make remote debug JVM not output text on stdout, stderr?
I'm currently writing a language server (atop of lsp4j), and need to debug my language server. 我正在编写一个语言服务器(在lsp4j上面),需要调试我的语言服务器。 Language server protocol servers uses stdin and stdout to communicate with the client.
语言服务器协议服务器使用stdin和stdout与客户端通信。
Now I want to debug a server that is launched from the client (VSCode), so I added in the debug flags for the spawned JVM process: 现在我想调试从客户端启动的服务器(VSCode),因此我在生成的JVM进程的调试标志中添加了:
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
Upon doing this suddenly, the server does not work any more, even though suspend = 0 and I confirmed the port is open and that no firewall malarkey is happening. 突然执行此操作后,服务器不再工作,即使suspend = 0并且我确认端口已打开并且没有发生防火墙malarkey。
I decided to run the command line manually, and I see that the first thing that a process does, after it receives the debug parameters is to output the following to stdout: 我决定手动运行命令行,我发现进程在收到调试参数后所做的第一件事是将以下内容输出到stdout:
Listening for transport dt_socket at address: 9999
(emitted without double quotes) (没有双引号发出)
I believe this is the reason that I cannot debug the language server, because outputting anything to stdout or stdin that is not part of the language server protocol spec forces the client to reject the server. 我相信这是我无法调试语言服务器的原因,因为输出任何不属于语言服务器协议规范的 stdout或stdin强制客户端拒绝服务器。
My question therefore, in a roundabout fashion is to ask if it is possible to make internal JVM messages on stdout, stdin, stderr silent via another JVM parameter? 因此,我的问题是,以一种迂回的方式询问是否可以通过另一个JVM参数在stdout,stdin,stderr上生成内部JVM消息?
Update: 更新:
The answer appears to be ",quiet=y" as an additional parameter. 答案似乎是“,quiet = y”作为附加参数。
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999,quiet=y
-Xrunjdwp:交通= dt_socket,服务器= Y,暂停= N,地址= 9999,安静= Y
Thank you to Christian Dietrich for providing the solution on the lsp4j github page. 感谢Christian Dietrich在lsp4j github页面上提供解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.