Java Stacktrace Print printStackTrace(Throwable t)

Here you can find the source of printStackTrace(Throwable t)

Description

print Stack Trace

License

Open Source License

Declaration

public static String printStackTrace(Throwable t) 

Method Source Code


//package com.java2s;
import java.io.PrintWriter;
import java.io.StringWriter;

public class Main {
    public static String printStackTrace(Throwable t) {
        StringWriter strWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(strWriter);
        if (t != null) {
            t.printStackTrace(printWriter);
        }//  w w w . j a  va2  s.c o  m
        return strWriter.getBuffer().toString();
    }
}

Related

  1. printStacktrace(Throwable aException)
  2. printStackTrace(Throwable e)
  3. printStackTrace(Throwable exception)
  4. printStackTrace(Throwable t)
  5. printStackTrace(Throwable t)
  6. printStackTrace(Throwable throwable)
  7. printStackTrace(Throwable throwable)
  8. printStackTraceAsHtml(Throwable t)
  9. printStackTraceElement(StackTraceElement element, StringBuilder buffer)