dcsimg

How can I customize the output of a stack trace?

John Zukowski

The Throwable class has a getStackTrace() method that returns an array of StackTraceElement objects. With an element, you can then print line numbers, file names, and method names in any style you'd like.