How do I print a Groovy stack trace? The Java method, Thread.currentThread().getStackTrace() produces a huge stack trace, including a lot of the Groovy internals. I’m seeing a function called twice from a StreamingMarkupBuilder that looks like it should only be called once and I would like to see why Groovy thinks it should be calling it twice.
How do I print a Groovy stack trace? The Java method, Thread.currentThread().getStackTrace() produces a
Share
Solution:
Original answer:
A Google search returns the following information:
Apparently, there is a method in
org.codehaus.groovy.runtime.StackTraceUtilscalledprintSanitizedStackTrace. There isn’t much documentation for the method, though there is a method calledsanitizewhich is described asSo I would try
org.codehaus.groovy.runtime.StackTraceUtils.printSanitizedStackTrace(Throwable t)(it is static)and see if that works for you.