Eclipse 插件读取标准错误

发布于 2024-09-18 17:00:19 字数 200 浏览 3 评论 0原文

我正在尝试编写一个 Eclipse 插件,它需要读取 eclipse 内的 std 错误。例如,控制台中出现的红色文本。

我找不到这样的正确的扩展点。我能找到的最好的是 org.eclipse.ui.console.consolePatternMatchListeners 但这只匹配控制台行,无论其来源如何。

有人知道执行此操作的方法或正确的扩展点吗?

I am trying to write an Eclipse plugin which needs to read the std error inside eclipse. E.g. the red text that appears in the console.

I cannot find the correct extension point for something like this. The best I could find was org.eclipse.ui.console.consolePatternMatchListeners but this just matches console lines regardless of their origin.

Anyone know a method to do this or the correct extension point?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖竹 2024-09-25 17:00:19

使用内部代码,您可以将侦听器添加到 ErrorStream

ProcessConsole con = ...
con.getProcess().getStreamsProxy().getErrorStreamMonitor().addListener(new IStreamListener() {
    @Override
    public void streamAppended(String text, IStreamMonitor monitor) {
        System.out.println("text=" + text);
    }
});

Using internal code you can add listner to ErrorStream

ProcessConsole con = ...
con.getProcess().getStreamsProxy().getErrorStreamMonitor().addListener(new IStreamListener() {
    @Override
    public void streamAppended(String text, IStreamMonitor monitor) {
        System.out.println("text=" + text);
    }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文