Java Stacktrace to String stackTraceToString(StackTraceElement[] stackTrace, StringBuilder buf)

Here you can find the source of stackTraceToString(StackTraceElement[] stackTrace, StringBuilder buf)

Description

stack Trace To String

License

Apache License

Declaration

public static void stackTraceToString(StackTraceElement[] stackTrace,
            StringBuilder buf) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void stackTraceToString(StackTraceElement[] stackTrace,
            StringBuilder buf) {//w  w w  .j  av  a  2  s  . c om

        String sep = System.getProperty("line.separator");

        for (int i = 0; i < stackTrace.length; i++) {
            StackTraceElement element = stackTrace[i];
            buf.append(sep + "\tat " + element.toString());
        }

    }
}

Related

  1. stackTraceToString(final Throwable t, final boolean header, final boolean trim)
  2. stacktraceToString(final Throwable throwable)
  3. stacktraceToString(StackTraceElement[] s)
  4. stackTraceToString(StackTraceElement[] stackTrace)
  5. stackTraceToString(StackTraceElement[] stackTrace)
  6. stackTraceToString(StackTraceElement[] ste)
  7. stackTraceToString(StackTraceElement[] trace)
  8. stackTraceToString(StackTraceElement[] trace)
  9. stackTraceToString(Throwable e)