1 19 package org.apache.avalon.excalibur.logger.logkit; 20 21 import org.apache.avalon.framework.logger.Logger; 22 import org.apache.avalon.framework.logger.LogEnabled; 23 import org.apache.log.Hierarchy; 24 25 26 35 public class LogKitLoggerHelper implements LogEnabled 36 { 37 38 private final Hierarchy m_hierarchy; 39 40 41 public LogKitLoggerHelper( final Hierarchy hierarchy ) 42 { 43 if ( hierarchy == null ) throw new NullPointerException ( "hierarchy" ); 44 m_hierarchy = hierarchy; 45 } 46 47 48 public void enableLogging( final Logger logger ) 49 { 50 if ( logger == null ) throw new NullPointerException ( "logger" ); 51 final ErrorHandlerAdapter errorHandler = new ErrorHandlerAdapter( logger ); 52 m_hierarchy.setErrorHandler( errorHandler ); 53 } 54 } 55 | Popular Tags |