1 package com.knowgate.debug; 2 3 import java.io.Writer ; 4 import java.io.StringWriter ; 5 import java.io.PrintWriter ; 6 import java.io.IOException ; 7 8 13 public final class StackTraceUtil { 14 15 public static String getStackTrace( Throwable aThrowable ) 16 throws IOException { 17 final Writer result = new StringWriter (); 18 final PrintWriter printWriter = new PrintWriter ( result ); 19 aThrowable.printStackTrace( printWriter ); 20 String sRetVal = result.toString(); 21 printWriter.close(); 22 result.close(); 23 return sRetVal; 24 } 25 } 26 | Popular Tags |