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

Class Class, % Method, % Line, %
JulLogger 0% (0/1) 0% (0/9) 0% (0/10)


1 package net.sf.persism.logging.implementation; 2  3 import net.sf.persism.logging.AbstractLogger; 4 import net.sf.persism.logging.LogMode; 5  6 import java.util.logging.Level; 7 import java.util.logging.Logger; 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 info(Object message) { 29  Logger.getLogger(logName).info(String.format("%s", message)); 30  } 31  32  @Override 33  public void info(Object message, Throwable t) { 34  Logger.getLogger(logName).log(Level.INFO, String.format("%s", message), t); 35  } 36  37  @Override 38  public void warn(Object message) { 39  Logger.getLogger(logName).warning(String.format("%s", message)); 40  } 41  42  @Override 43  public void warn(Object message, Throwable t) { 44  Logger.getLogger(logName).log(Level.WARNING, String.format("%s", message), t); 45  } 46  47  @Override 48  public void error(Object message) { 49  Logger.getLogger(logName).severe(String.format("%s", message)); 50  } 51  52  @Override 53  public void error(Object message, Throwable t) { 54  Logger.getLogger(logName).log(Level.SEVERE, String.format("%s", message), t); 55  } 56 }