public static void stacktrace() { for (final StackTraceElement ste : Thread.currentThread().getStackTrace()) { System.out.println(ste.toString()); } }Example use:
if (somethingIsWrong()) { stacktrace(); }
public static void stacktrace() { for (final StackTraceElement ste : Thread.currentThread().getStackTrace()) { System.out.println(ste.toString()); } }Example use:
if (somethingIsWrong()) { stacktrace(); }