public static StringBuilder createStackTrace ( StringBuilder s , StackTraceElement [ ] stack ) { if ( stack != null ) for ( StackTraceElement e : stack ) { s . append ( "\n\tat " ) ; s . append ( e . getClassName ( ) ) ; if ( e . getMethodName ( ) != null ) { s . append ( ' ' ) ; s . append ( e . getMethodName ( ) ) ; } if ( e . getFileName ( ) != null ) { s . append ( ' ' ) ; s . append ( e . getFileName ( ) ) ; s . append ( ' ' ) ; s . append ( e . getLineNumber ( ) ) ; s . append ( ' ' ) ; } } return s ; }
Append a stack trace to a StringBuilder .