public static String formatStackTrace ( StackTraceElement [ ] stackTrace ) { StringBuilder sb = new StringBuilder ( ) ; for ( StackTraceElement element : stackTrace ) { sb . append ( " at " ) . append ( element . toString ( ) ) ; sb . append ( "\n" ) ; } return sb . toString ( ) ; }
Print thread stack