public static String stackToDebugString ( Throwable e ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; e . printStackTrace ( pw ) ; pw . close ( ) ; String text = sw . toString ( ) ; // Jump past the throwable text = text . substring ( text . indexOf ( "at" ) ) ; return text ; }
Get a string containing the stack of the specified exception