1 55 package org.apache.avalon.framework.logger; 56 57 import org.apache.log4j.Level; 58 59 65 public final class Log4JLogger 66 implements Logger 67 { 68 private final org.apache.log4j.Logger m_logger; 70 71 76 public Log4JLogger( final org.apache.log4j.Logger logImpl ) 77 { 78 m_logger = logImpl; 79 } 80 81 86 public final void debug( final String message ) 87 { 88 m_logger.debug( message ); 89 } 90 91 97 public final void debug( final String message, final Throwable throwable ) 98 { 99 m_logger.debug( message, throwable ); 100 } 101 102 107 public final boolean isDebugEnabled() 108 { 109 return m_logger.isDebugEnabled(); 110 } 111 112 117 public final void info( final String message ) 118 { 119 m_logger.info( message ); 120 } 121 122 128 public final void info( final String message, final Throwable throwable ) 129 { 130 m_logger.info( message, throwable ); 131 } 132 133 138 public final boolean isInfoEnabled() 139 { 140 return m_logger.isInfoEnabled(); 141 } 142 143 148 public final void warn( final String message ) 149 { 150 m_logger.warn( message ); 151 } 152 153 159 public final void warn( final String message, final Throwable throwable ) 160 { 161 m_logger.warn( message, throwable ); 162 } 163 164 169 public final boolean isWarnEnabled() 170 { 171 return m_logger.isEnabledFor( Level.WARN ); 172 } 173 174 179 public final void error( final String message ) 180 { 181 m_logger.error( message ); 182 } 183 184 190 public final void error( final String message, final Throwable throwable ) 191 { 192 m_logger.error( message, throwable ); 193 } 194 195 200 public final boolean isErrorEnabled() 201 { 202 return m_logger.isEnabledFor( Level.ERROR ); 203 } 204 205 210 public final void fatalError( final String message ) 211 { 212 m_logger.fatal( message ); 213 } 214 215 221 public final void fatalError( final String message, final Throwable throwable ) 222 { 223 m_logger.fatal( message, throwable ); 224 } 225 226 231 public final boolean isFatalErrorEnabled() 232 { 233 return m_logger.isEnabledFor( Level.FATAL ); 234 } 235 236 244 public final Logger getChildLogger( final String name ) 245 { 246 return new Log4JLogger( org.apache.log4j.Logger.getLogger( m_logger.getName() + "." + name ) ); 247 } 248 } 249 | Popular Tags |