Java Throwable to String getStackTrace(Throwable t)

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

Description

get Stack Trace

License

LGPL

Declaration

public static String getStackTrace(Throwable t) 

Method Source Code

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

import java.io.*;

public class Main {
    public static String getStackTrace(Throwable t) {
        return printStackTrace(t);
    }//from www . j a  v a 2  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. getStackTrace(Throwable t)
  2. getStackTrace(Throwable t)
  3. getStackTrace(Throwable t)
  4. getStackTrace(Throwable t)
  5. getStackTrace(Throwable t)
  6. getStackTrace(Throwable t)
  7. getStackTrace(Throwable t)
  8. GetStacktrace(Throwable t)
  9. getStackTrace(Throwable t)