清除Java堆栈跟踪中的噪音 [英] Cleaning noise out of Java stack traces
问题描述
如果这个工作无处不在,最好在Eclipse jUnit转轮中。
一个href =/ questions / tagged / eclipseclass =post-tagtitle =显示问题标记'eclipse' =tag> eclipse 有一个偏好堆栈跟踪过滤器模式(查看 java > junit 或在首选项中搜索 stacktrace
)。您可以忽略包(通配符),类或方法。适用于直接测试呼叫(通过运行 junit 测试),而不是命令行运行,如 ant
或 maven
。
My Java stack traces have a lot of entries that I don't care about, showing method invocation going through proxies and Spring reflection methods and stuff like that. It can make it pretty hard to pick out the part of the stack trace that's actually from my code. Ruby on Rails includes a "stack trace cleaner" where you can specify a list of stack trace patterns to omit from printed stack traces - what's the best way to do something like that, universally, for Java?
It'd be best if this worked everywhere, including in the Eclipse jUnit runner.
eclipse has a preference Stack trace filter patterns (look at java > junit or search for stacktrace
in the preferences). You can ignore packages (also with wildcards), classes or methods. Does work for direct Test calls (via Run as junit Test), not for commandline runs like ant
or maven
.
这篇关于清除Java堆栈跟踪中的噪音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!