donaldp 01/04/18 05:34:44 Added: src/java/org/apache/avalon/logger AbstractLoggable.java Loggable.java Log: Migrate logger related cut to logger sub-package Revision Changes Path 1.1 jakarta-avalon/src/java/org/apache/avalon/logger/AbstractLoggable.java Index: AbstractLoggable.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org.apache.avalon.logger; import org.apache.log.Logger; /** * Helper class to inherit from. * * @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a> */ public abstract class AbstractLoggable implements Loggable { protected Logger m_logger; public void setLogger( final Logger logger ) { m_logger = logger; } protected final Logger getLogger() { return m_logger; } protected void setupLogger( final Object component ) { setupLogger( component, (String)null ); } protected void setupLogger( final Object component, final String subCategory ) { if( component instanceof Loggable ) { Logger logger = m_logger; if( null != subCategory ) { logger = m_logger.getChildLogger( subCategory ); } ((Loggable)component).setLogger( logger ); } } protected void setupLogger( final Object component, final Logger logger ) { if( component instanceof Loggable ) { ((Loggable)component).setLogger( logger ); } } } 1.1 jakarta-avalon/src/java/org/apache/avalon/logger/Loggable.java Index: Loggable.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org.apache.avalon.logger; import org.apache.log.Logger; /** * Interface through which to provide Loggers. * * @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a> */ public interface Loggable { void setLogger( Logger logger ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]