ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant XmlLogger.java
Date Sat, 15 Dec 2001 00:30:55 GMT
sbailliez    01/12/14 16:30:55

  Modified:    src/main/org/apache/tools/ant XmlLogger.java
  Log:
  Take advantage of StringUtils
  
  Revision  Changes    Path
  1.17      +2 -6      jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java
  
  Index: XmlLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XmlLogger.java	2001/11/18 20:15:30	1.16
  +++ XmlLogger.java	2001/12/15 00:30:55	1.17
  @@ -68,6 +68,7 @@
   import org.w3c.dom.Element;
   import org.w3c.dom.Text;
   import org.apache.tools.ant.util.DOMElementWriter;
  +import org.apache.tools.ant.util.StringUtils;
   
   /**
    *  Generates a "log.xml" file in the current directory with
  @@ -133,13 +134,8 @@
               buildElement.element.setAttribute(ERROR_ATTR, event.getException().toString());
               // print the stacktrace in the build file it is always useful...
               // better have too much info than not enough.
  -            ByteArrayOutputStream baos = new ByteArrayOutputStream();
  -            PrintStream ps = new PrintStream(baos,true);
               Throwable t = event.getException();
  -            t.printStackTrace(ps);
  -            ps.flush();
  -            ps.close();
  -            Text errText =  doc.createCDATASection(baos.toString());
  +            Text errText =  doc.createCDATASection(StringUtils.getStackTrace(t));
               Element stacktrace = doc.createElement(STACKTRACE_TAG);
               stacktrace.appendChild(errText);
               buildElement.element.appendChild(stacktrace);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message