Here you can find the source of getStacktraceAsString(Exception e)
Parameter | Description |
---|---|
e | The Exception containing the stacktrace |
public static String getStacktraceAsString(Exception e)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { /**/* w w w. ja v a 2s. c o m*/ * Produce a string version of a stacktrace. * @param e The Exception containing the stacktrace * @return The stacktrace as a String. */ public static String getStacktraceAsString(Exception e) { final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); return result.toString(); } }