Java Stacktrace Print printStackTrace(Throwable t)

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

Description

Use with caution: lots of overhead

License

LGPL

Declaration

public static String printStackTrace(Throwable t) 

Method Source Code

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

import java.io.*;

public class Main {
    /**/* w  w w .  j a va2 s  .c  o m*/
     * Use with caution: lots of overhead
     */
    public static String printStackTrace(Throwable t) {
        StringWriter s = new StringWriter();
        PrintWriter p = new PrintWriter(s);
        t.printStackTrace(p);
        return s.toString();
    }
}

Related

  1. printStackTrace(String msg, StackTraceElement[] trace, PrintStream out)
  2. printStackTrace(String msg, Throwable throwable)
  3. printStacktrace(Throwable aException)
  4. printStackTrace(Throwable e)
  5. printStackTrace(Throwable exception)
  6. printStackTrace(Throwable t)
  7. printStackTrace(Throwable t)
  8. printStackTrace(Throwable throwable)
  9. printStackTrace(Throwable throwable)