开发者

Eclipse Plugin Read Std Error

开发者 https://www.devze.com 2023-01-16 06:32 出处:网络
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 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 orig开发者_开发技巧in.

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


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);
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号