Coverage Summary for Class: JulLogger (net.sf.persism.logging)

Class Class, % Method, % Line, %
JulLogger 100% (1/1) 100% (10/10) 83.3% (10/12)


1 package net.sf.persism.logging; 2  3 import java.util.logging.Level; 4 import java.util.logging.Logger; 5  6 /** 7  * @hidden 8  */ 9 public final class JulLogger extends AbstractLogger { 10  11  public JulLogger(String logName) { 12  super(LogMode.JUL, logName); 13  } 14  15  @Override 16  public boolean isDebugEnabled() { 17  return Logger.getLogger(logName).isLoggable(Level.FINE); 18  } 19  20  @Override 21  public void debug(Object message, Object... params) { 22  if (isDebugEnabled()) { 23  Logger.getLogger(logName).fine(String.format("" + message, params)); 24  } 25  } 26  27  @Override 28  public void debug(Object message) { 29  if (isDebugEnabled()) { 30  Logger.getLogger(logName).fine("" + message); 31  } 32  } 33  34  @Override 35  public void info(Object message) { 36  Logger.getLogger(logName).info(String.format("%s", message)); 37  } 38  39  @Override 40  public void info(Object message, Throwable t) { 41  Logger.getLogger(logName).log(Level.INFO, String.format("%s", message), t); 42  } 43  44  @Override 45  public void warn(Object message) { 46  Logger.getLogger(logName).warning(String.format("%s", message)); 47  } 48  49  @Override 50  public void warn(Object message, Throwable t) { 51  Logger.getLogger(logName).log(Level.WARNING, String.format("%s", message), t); 52  } 53  54  @Override 55  public void error(Object message) { 56  Logger.getLogger(logName).severe(String.format("%s", message)); 57  } 58  59  @Override 60  public void error(Object message, Throwable t) { 61  Logger.getLogger(logName).log(Level.SEVERE, String.format("%s", message), t); 62  } 63 }