avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component LogKit2LoggerTarget.java LogkitLoggerManager.java
Date Thu, 12 Sep 2002 15:47:53 GMT
leif        2002/09/12 08:47:53

  Modified:    component/src/java/org/apache/avalon/excalibur/component
                        LogKit2LoggerTarget.java LogkitLoggerManager.java
  Log:
  Fix a problem where component categories were not being set correctly after
  getLogKitManager was called.
  
  Revision  Changes    Path
  1.3       +2 -20     jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/LogKit2LoggerTarget.java
  
  Index: LogKit2LoggerTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/LogKit2LoggerTarget.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LogKit2LoggerTarget.java	2 Jun 2002 06:03:01 -0000	1.2
  +++ LogKit2LoggerTarget.java	12 Sep 2002 15:47:53 -0000	1.3
  @@ -46,7 +46,7 @@
   
       public void processEvent( LogEvent event )
       {
  -        final Logger logger = getLoggerForEvent( event );
  +        final Logger logger = m_logger;
   
           final String message = event.getMessage();
           final Throwable throwable = event.getThrowable();
  @@ -71,23 +71,5 @@
           {
               logger.fatalError( message, throwable );
           }
  -    }
  -
  -    /**
  -     * Retrieve Logger for event. If event is from a child
  -     * Log
  -     *
  -     * @param event the LogEvent
  -     * @return the Logger
  -     */
  -    private Logger getLoggerForEvent( final LogEvent event )
  -    {
  -        final String category = event.getCategory();
  -        Logger logger = m_logger;
  -        if( !"".equals( category ) )
  -        {
  -            logger = m_logger.getChildLogger( category );
  -        }
  -        return logger;
       }
   }
  
  
  
  1.4       +6 -18     jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/LogkitLoggerManager.java
  
  Index: LogkitLoggerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/LogkitLoggerManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LogkitLoggerManager.java	29 Jul 2002 09:53:40 -0000	1.3
  +++ LogkitLoggerManager.java	12 Sep 2002 15:47:53 -0000	1.4
  @@ -31,32 +31,20 @@
           m_logKitManager = logKitManager;
       }
   
  -    public org.apache.log.Logger
  -        getLogKitLoggerForCategory( final String categoryName )
  +    public org.apache.log.Logger getLogKitLoggerForCategory( final String categoryName
)
       {
  -        if( null != m_logKitManager )
  -        {
  -            return m_logKitManager.getLogger( categoryName );
  -        }
  -        else
  -        {
  -            final Logger logger =
  -                m_loggerManager.getLoggerForCategory( categoryName );
  -            return LogKit2LoggerTarget.createLogger( logger );
  -        }
  +        return getLogKitManager().getLogger( categoryName );
       }
   
       public Logger getLoggerForCategory( String categoryName )
       {
  -        if( null != m_logKitManager )
  +        if( null != m_loggerManager )
           {
  -            final org.apache.log.Logger logger =
  -                m_logKitManager.getLogger( categoryName );
  -            return new LogKitLogger( logger );
  +            return m_loggerManager.getLoggerForCategory( categoryName );
           }
           else
           {
  -            return m_loggerManager.getLoggerForCategory( categoryName );
  +            return new LogKitLogger( getLogKitLoggerForCategory( categoryName ) );
           }
       }
   
  
  
  

--
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