Here you can find the source of stackTraceToString(Throwable t)
Parameter | Description |
---|---|
t | a parameter |
private static String stackTraceToString(Throwable t)
//package com.java2s; import java.io.PrintWriter; import java.io.StringWriter; public class Main { /**/* ww w .j a va2 s .c o m*/ * @param t * @return A stack trace as a string. */ private static String stackTraceToString(Throwable t) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); return sw.getBuffer().toString(); } }