1 55 package org.apache.avalon.framework.logger; 56 57 import java.util.logging.Level ; 58 59 83 public final class Jdk14Logger 84 implements Logger 85 { 86 private final java.util.logging.Logger m_logger; 88 89 94 public Jdk14Logger( java.util.logging.Logger logImpl ) 95 { 96 m_logger = logImpl; 97 } 98 99 104 public final void debug( final String message ) 105 { 106 m_logger.log( Level.FINE, message ); 107 } 108 109 115 public final void debug( final String message, final Throwable throwable ) 116 { 117 m_logger.log( Level.FINE, message, throwable ); 118 } 119 120 125 public final boolean isDebugEnabled() 126 { 127 return m_logger.isLoggable( Level.FINE ); 128 } 129 130 135 public final void info( final String message ) 136 { 137 m_logger.log( Level.INFO, message ); 138 } 139 140 146 public final void info( final String message, final Throwable throwable ) 147 { 148 m_logger.log( Level.INFO, message, throwable ); 149 } 150 151 156 public final boolean isInfoEnabled() 157 { 158 return m_logger.isLoggable( Level.INFO ); 159 } 160 161 166 public final void warn( final String message ) 167 { 168 m_logger.log( Level.WARNING, message ); 169 } 170 171 177 public final void warn( final String message, final Throwable throwable ) 178 { 179 m_logger.log( Level.WARNING, message, throwable ); 180 } 181 182 187 public final boolean isWarnEnabled() 188 { 189 return m_logger.isLoggable( Level.WARNING ); 190 } 191 192 197 public final void error( final String message ) 198 { 199 m_logger.log( Level.SEVERE, message ); 200 } 201 202 208 public final void error( final String message, final Throwable throwable ) 209 { 210 m_logger.log( Level.SEVERE, message, throwable ); 211 } 212 213 218 public final boolean isErrorEnabled() 219 { 220 return m_logger.isLoggable( Level.SEVERE ); 221 } 222 223 228 public final void fatalError( final String message ) 229 { 230 m_logger.log( Level.SEVERE, message ); 231 } 232 233 239 public final void fatalError( final String message, final Throwable throwable ) 240 { 241 m_logger.log( Level.SEVERE, message, throwable ); 242 } 243 244 249 public final boolean isFatalErrorEnabled() 250 { 251 return m_logger.isLoggable( Level.SEVERE ); 252 } 253 254 262 public final Logger getChildLogger( final String name ) 263 { 264 return new Jdk14Logger( java.util.logging.Logger 265 .getLogger( m_logger.getName() + "." + name ) ); 266 } 267 } 268 | Popular Tags |