ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant XmlLogger.java
Date Mon, 10 Sep 2001 15:39:43 GMT
donaldp     01/09/10 08:39:43

  Modified:    src/main/org/apache/tools/ant XmlLogger.java
  Log:
  I added an XML declaration (<?xml version="1.0"?>) to the XML log file.
  Also, I removed some extra spaces in XmlLogger.java.
  
  Submitted by: "Ingmar Stein" <stein@xtramind.com>
  
  Revision  Changes    Path
  1.10      +12 -11    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XmlLogger.java	2001/08/30 13:26:37	1.9
  +++ XmlLogger.java	2001/09/10 15:39:43	1.10
  @@ -130,14 +130,15 @@
               if (outFilename == null) {
                   outFilename = "log.xml";
               }
  -            
  +
               // specify output in UTF8 otherwise accented characters will blow
               // up everything
               Writer out =
                   new OutputStreamWriter(new FileOutputStream(outFilename),
                                          "UTF8");
  +            out.write("<?xml version=\"1.0\"?>\n");
               out.write("<?xml:stylesheet type=\"text/xsl\" href=\"log.xsl\"?>\n\n");
  -                      (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
  +            (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
               out.flush();
               out.close();
               
  @@ -155,7 +156,7 @@
           }
           return threadStack;
       }
  -    
  +
       public void targetStarted(BuildEvent event) {
           Target target = event.getTarget();
           TimedElement targetElement = new TimedElement();
  @@ -173,14 +174,14 @@
               long totalTime = System.currentTimeMillis() - targetElement.startTime;
               targetElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime));
   
  -            TimedElement parentElement = null;            
  +            TimedElement parentElement = null;
               Stack threadStack = getStack();
               if (!threadStack.empty()) {
                   TimedElement poppedStack = (TimedElement)threadStack.pop();
                   if (poppedStack != targetElement) {
                       throw new RuntimeException("Mismatch - popped element = " + poppedStack.element
+
                       " finished task element = " + targetElement.element);
  -                }                                           
  +                }
                   if (!threadStack.empty()) {
                       parentElement = (TimedElement)threadStack.peek();
                   }
  @@ -188,7 +189,7 @@
               if (parentElement == null) {
                   buildElement.element.appendChild(targetElement.element);
               }
  -            else {                
  +            else {
                   parentElement.element.appendChild(targetElement.element);
               }
           }
  @@ -231,7 +232,7 @@
                   if (poppedStack != taskElement) {
                       throw new RuntimeException("Mismatch - popped element = " + poppedStack.element
+
                       " finished task element = " + taskElement.element);
  -                }                                           
  +                }
               }
           }
       }
  @@ -239,7 +240,7 @@
       public void messageLogged(BuildEvent event) {
           Element messageElement = doc.createElement(MESSAGE_TAG);
   
  -        String name = "debug";
  +        String name;
           switch(event.getPriority()) {
               case Project.MSG_ERR: name = "error"; break;
               case Project.MSG_WARN: name = "warn"; break;
  @@ -252,7 +253,7 @@
           messageElement.appendChild(messageText);
   
           TimedElement parentElement = null;
  -        
  +
           Task task = event.getTask();
           Target target = event.getTarget();
           if (task != null) {
  @@ -261,7 +262,7 @@
           if (parentElement == null && target != null) {
               parentElement = (TimedElement)targets.get(target);
           }
  -         
  +
           if (parentElement == null) {
               Stack threadStack = (Stack)threadStacks.get(Thread.currentThread());
               if (threadStack != null) {
  @@ -270,7 +271,7 @@
                   }
               }
           }
  -        
  +
           if (parentElement != null) {
               parentElement.element.appendChild(messageElement);
           }
  
  
  

Mime
View raw message