1 55 package org.apache.avalon.framework.logger; 56 57 64 public abstract class AbstractLoggable 65 implements Loggable 66 { 67 private org.apache.log.Logger m_logger; 69 70 75 public void setLogger( final org.apache.log.Logger logger ) 76 { 77 m_logger = logger; 78 } 79 80 91 protected final org.apache.log.Logger getLogger() 92 { 93 return m_logger; 94 } 95 96 101 protected void setupLogger( final Object component ) 102 { 103 setupLogger( component, (String )null ); 104 } 105 106 113 protected void setupLogger( final Object component, final String subCategory ) 114 { 115 org.apache.log.Logger logger = m_logger; 116 117 if( null != subCategory ) 118 { 119 logger = m_logger.getChildLogger( subCategory ); 120 } 121 122 setupLogger( component, logger ); 123 } 124 125 131 protected void setupLogger( final Object component, final org.apache.log.Logger logger ) 132 { 133 if( component instanceof Loggable ) 134 { 135 ( (Loggable)component ).setLogger( logger ); 136 } 137 } 138 } 139 | Popular Tags |