public static final String stackTrace(Throwable e){
  String foo=null;
  try {
    ByteArrayOutputStream ostr=new ByteArrayOutputStream();
    e.printStackTrace(new PrintWriter(ostr,true));
    foo=ostr.toString();
  }
 catch (  Exception f) {
  }
  return foo;
}

public static final String stackTrace ( Throwable e ) { String foo = null ; try { ByteArrayOutputStream ostr = new ByteArrayOutputStream ( ) ; e . printStackTrace ( new PrintWriter ( ostr , true ) ) ; foo = ostr . toString ( ) ; } catch ( Exception f ) { } return foo ; }
returns the output of printstacktrace as a string .
