Java Stacktrace Print printStackTrace(String header, int depth)

Here you can find the source of printStackTrace(String header, int depth)

Description

print Stack Trace

License

Open Source License

Declaration

public static void printStackTrace(String header, int depth) 

Method Source Code

//package com.java2s;

public class Main {
    public static void printStackTrace(String header, int depth) {
        System.out.println(header);

        int i = 0;
        for (StackTraceElement se : Thread.currentThread().getStackTrace()) {
            System.out.println(se);
            if (i++ > depth) {
                break;
            }/*from   ww  w  .j  av a2 s .c om*/
        }
    }
}

Related

  1. printStackTrace(PrintWriter writer, Thread thread, StackTraceElement[] trace)
  2. printStackTrace(StackTraceElement[] elements)
  3. printStackTrace(StackTraceElement[] elements)
  4. printStackTrace(StackTraceElement[] stackTrace)
  5. printStackTrace(StackTraceElement[] stes, String filter)
  6. printStackTrace(String msg, StackTraceElement[] trace, PrintStream out)
  7. printStackTrace(String msg, Throwable throwable)
  8. printStacktrace(Throwable aException)
  9. printStackTrace(Throwable e)