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 Mon, 14 Oct 2002 14:07:19 GMT
donaldp     2002/10/14 07:07:18

  Modified:    lib      Tag: RELEASE_402-branch excalibur-logger-1.0.jar
               src/java/org/apache/avalon/phoenix/components/logger Tag:
                        RELEASE_402-branch DefaultLogManager.java
  Log:
  Backport fixes for Logger from HEAD.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +375 -378  jakarta-avalon-phoenix/lib/excalibur-logger-1.0.jar
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.1  +16 -13    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.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- DefaultLogManager.java	23 Aug 2002 04:08:54 -0000	1.19
  +++ DefaultLogManager.java	14 Oct 2002 14:07:18 -0000	1.19.2.1
  @@ -10,7 +10,9 @@
   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.container.ContainerUtil;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  @@ -46,8 +48,10 @@
                                      final ClassLoader classLoader )
           throws Exception
       {
  +        final String sarName = metaData.getName();
  +
           final DefaultContext context = new DefaultContext();
  -        context.put( BlockContext.APP_NAME, metaData.getName() );
  +        context.put( BlockContext.APP_NAME, sarName );
           context.put( BlockContext.APP_HOME_DIR, metaData.getHomeDirectory() );
           context.put( "classloader", classLoader );
   
  @@ -56,26 +60,25 @@
           if( getLogger().isDebugEnabled() )
           {
               final String message =
  -                REZ.getString( "logger-create", metaData.getName(), version );
  +                REZ.getString( "logger-create", sarName, 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