Here you can find the source of getStackTrace(Throwable t)
Parameter | Description |
---|---|
t | a parameter |
public static String getStackTrace(Throwable t)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayOutputStream; import java.io.PrintWriter; public class Main { /**//from w ww .j av a 2 s. c o m * * @param t * @return */ public static String getStackTrace(Throwable t) { ByteArrayOutputStream bao = new ByteArrayOutputStream(1024); PrintWriter pr = new PrintWriter(bao); t.printStackTrace(pr); return bao.toString(); } }