开发者

Customize Eclipse's java stack trace console formatter

开发者 https://www.devze.com 2023-02-10 16:56 出处:网络
Eclipse has a stack trace console where you can paste in any stack trace, and it\'ll try to make the MyClass:143 references clickable. There\'s a format function that does this for you, but the stack

Eclipse has a stack trace console where you can paste in any stack trace, and it'll try to make the MyClass:143 references clickable. There's a format function that does this for you, but the stack traces I get from my app's log files are big single lines with &s separating each trace item.

Is there a way to customize the format function so it'll also do a global replace? In my case I want to do s/&/\n/

开发者_运维百科

The only other question I've found just talks about using this console, not modifying the format function.


I've not seen anything in the preferences for this, also from looking at the code in Eclipse this area doesn't seem particularly extensible.

I think you'd have to contribute your own action to the console, however you'd have to write a bit of code... Take a look at FormatStackTraceActionDelegate - the result of running this action eventually calls: private String format(String trace) in JavaStackTraceConsole That's really where you want to hook in right?

If it were me, and something I was doing all the time I'd write the action, however it may be a lot of work for the reward.

0

精彩评论

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

关注公众号