自定义 Eclipse 的 java 堆栈跟踪控制台格式化程序
Eclipse 有一个堆栈跟踪控制台,您可以在其中粘贴任何堆栈跟踪,并且它会尝试使 MyClass:143 引用可单击。有一个 format 函数 可以为您执行此操作,但是我从应用程序的日志文件中获得的堆栈跟踪是大的单行,并用 &s 分隔每个跟踪项。
有没有办法自定义格式函数,以便它也可以进行全局替换?就我而言,我想做 s/&/\n/
唯一的其他问题我发现只是讨论使用这个控制台,而不是修改格式函数。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在首选项中没有看到任何与此相关的内容,而且从查看 Eclipse 中的代码来看,该区域似乎不是特别可扩展。
我认为你必须向控制台贡献你自己的操作,但是你必须编写一些代码......
看一下 FormatStackTraceActionDelegate - 运行此操作的结果最终调用:
JavaStackTraceConsole 中的私有字符串格式(字符串跟踪)
这确实是你想要加入的地方,对吗?
如果是我,并且我一直在做某件事,我会写下动作,但是为了获得奖励可能需要做很多工作。
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.