costin      2002/08/22 10:31:15

  Modified:    src/main/org/apache/tools/ant ProjectComponent.java
  Log:
  If no logger is set, default to system.out instead of ignoring the
  message.
  
  This happens when ant is embeded ( if no logger is set ).
  
  Revision  Changes    Path
  1.6       +6 -0      
jakarta-ant/src/main/org/apache/tools/ant/ProjectComponent.java
  
  Index: ProjectComponent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectComponent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProjectComponent.java     23 Jul 2002 07:54:46 -0000      1.5
  +++ ProjectComponent.java     22 Aug 2002 17:31:15 -0000      1.6
  @@ -115,6 +115,12 @@
       public void log(String msg, int msgLevel) {
           if (project != null) {
               project.log(msg, msgLevel);
  +        } else {
  +            // 'reasonable' default, if the component is used without
  +            // a Project ( for example as a standalone Bean ).
  +            // Most ant components can be used this way.
  +            if( msgLevel >= Project.MSG_INFO )
  +                System.err.println( msg );
           }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to