avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger DefaultLogManager.java
Date Sat, 21 Sep 2002 02:56:28 GMT
donaldp     2002/09/20 19:56:28

  Modified:    src/java/org/apache/avalon/phoenix/components/logger
                        DefaultLogManager.java
  Log:
  Clean up LoggerManager now that we use the same interface for both toolkits.
  
  Revision  Changes    Path
  1.20      +12 -11    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java
  
  Index: DefaultLogManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultLogManager.java	23 Aug 2002 04:08:54 -0000	1.19
  +++ DefaultLogManager.java	21 Sep 2002 02:56:28 -0000	1.20
  @@ -10,10 +10,12 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.logger.LogKitLoggerManager;
  +import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.phoenix.BlockContext;
   import org.apache.avalon.phoenix.interfaces.LogManager;
   import org.apache.avalon.phoenix.metadata.SarMetaData;
  @@ -59,23 +61,22 @@
                   REZ.getString( "logger-create", metaData.getName(), version );
               getLogger().debug( message );
           }
  +        final LoggerManager loggerManager = createLoggerManager( version );
  +        ContainerUtil.enableLogging( loggerManager, getLogger() );
  +        ContainerUtil.contextualize( loggerManager, context );
  +        ContainerUtil.configure( loggerManager, logs );
  +        return loggerManager.getDefaultLogger();
  +    }
   
  +    private LoggerManager createLoggerManager( final String version )
  +    {
           if( version.equals( "1.0" ) )
           {
  -            final SimpleLogKitManager manager = new SimpleLogKitManager();
  -            setupLogger( manager );
  -            manager.contextualize( context );
  -            manager.configure( logs );
  -            return manager.getDefaultLogger();
  +            return new SimpleLogKitManager();
           }
           else if( version.equals( "1.1" ) )
           {
  -            final LogKitLoggerManager manager =
  -                new LogKitLoggerManager();
  -            setupLogger( manager );
  -            manager.contextualize( context );
  -            manager.configure( logs );
  -            return manager.getDefaultLogger();
  +            return new LogKitLoggerManager();
           }
           else
           {
  
  
  

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


Mime
View raw message