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/proposal/myrmidon/src/java/org/apache/myrmidon/frontends CLIMain.java
Date Fri, 29 Jun 2001 08:58:42 GMT
donaldp     01/06/29 01:58:42

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
               proposal/myrmidon/src/java/org/apache/myrmidon/frontends
                        CLIMain.java
  Log:
  Separated Log hierarchy for tasks and engine.
  
  Revision  Changes    Path
  1.3       +12 -1     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultWorkspace.java	2001/06/29 08:08:28	1.2
  +++ DefaultWorkspace.java	2001/06/29 08:58:40	1.3
  @@ -23,7 +23,9 @@
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.log.Hierarchy;
   import org.apache.log.Logger;
  +import org.apache.log.LogTarget;
   import org.apache.myrmidon.api.DefaultTaskContext;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  @@ -56,6 +58,8 @@
       private TaskContext              m_baseContext;
       private HashMap                  m_entrys            = new HashMap();
       private TypeManager              m_typeManager;
  +    private Hierarchy                m_hierarchy;
  +    private int                      m_projectID;
   
       /**
        * Add a listener to project events.
  @@ -101,6 +105,11 @@
           throws Exception
       {
           m_baseContext = createBaseContext();
  +
  +        m_hierarchy = new Hierarchy();
  +
  +        final LogTarget target = new LogTargetToListenerAdapter( m_listenerSupport );
  +        m_hierarchy.setDefaultLogTarget( target );
       }
   
       /**
  @@ -253,8 +262,10 @@
   
           try
           {
  +            final Logger logger = m_hierarchy.getLoggerFor( "project" + m_projectID );
  +            m_projectID++;
   
  -            frame.setLogger( getLogger() );
  +            frame.setLogger( logger );
               frame.contextualize( context );
               frame.compose( componentManager );
           }
  
  
  
  1.8       +5 -4      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CLIMain.java	2001/06/29 08:08:30	1.7
  +++ CLIMain.java	2001/06/29 08:58:41	1.8
  @@ -32,6 +32,7 @@
   import org.apache.log.LogTarget;
   import org.apache.log.Logger;
   import org.apache.log.Priority;
  +import org.apache.log.output.DefaultOutputLogTarget;
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.DefaultTaskContext;
   import org.apache.myrmidon.api.TaskContext;
  @@ -40,7 +41,6 @@
   import org.apache.myrmidon.components.executor.Executor;
   import org.apache.myrmidon.components.embeddor.Embeddor;
   import org.apache.myrmidon.components.embeddor.DefaultEmbeddor;
  -import org.apache.myrmidon.components.workspace.LogTargetToListenerAdapter;
   import org.apache.myrmidon.components.workspace.Workspace;
   import org.apache.myrmidon.components.model.Project;
   import org.apache.myrmidon.listeners.ProjectListener;
  @@ -321,9 +321,6 @@
           final String listenerName = m_parameters.getParameter( "listener", null );
           final ProjectListener listener = createListener( listenerName );
   
  -        final LogTarget target = new LogTargetToListenerAdapter( listener );
  -        getLogger().setLogTargets( new LogTarget[] { target } );
  -
           getLogger().warn( "Ant Build File: " + buildFile );
           getLogger().info( "Ant Home Directory: " + homeDir );
           //getLogger().info( "Ant Bin Directory: " + m_binDir );
  @@ -431,6 +428,10 @@
           }
   
           final Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor( "myrmidon"
);
  +
  +        final DefaultOutputLogTarget target = new DefaultOutputLogTarget();
  +        target.setFormat( "[%8.8{category}] %{message}\\n%{throwable}" );
  +        logger.setLogTargets( new LogTarget[] { target } );
   
           logger.setPriority( priority );
   
  
  
  

Mime
View raw message