Coverage Summary for Class: Slf4jLogger (net.sf.persism.logging.implementation)
Class |
Class, %
|
Method, %
|
Line, %
|
Slf4jLogger |
100%
(1/1)
|
100%
(9/9)
|
100%
(10/10)
|
1 package net.sf.persism.logging.implementation;
2
3 import net.sf.persism.logging.AbstractLogger;
4 import net.sf.persism.logging.LogMode;
5 import org.apache.log4j.Logger;
6 import org.slf4j.LoggerFactory;
7 import org.slf4j.Marker;
8
9 public final class Slf4jLogger extends AbstractLogger {
10
11 public Slf4jLogger(String logName) {
12 super(LogMode.SLF4J, logName);
13 }
14
15 @Override
16 public boolean isDebugEnabled() {
17 return LoggerFactory.getLogger(logName).isDebugEnabled();
18 }
19
20 @Override
21 public void debug(Object message, Object... params) {
22 if (isDebugEnabled()) {
23 LoggerFactory.getLogger(logName).debug(String.format(""+message, params));
24 }
25 }
26
27 @Override
28 public void info(Object message) {
29 LoggerFactory.getLogger(logName).info(String.format("%s", message));
30 }
31
32 @Override
33 public void info(Object message, Throwable t) {
34 LoggerFactory.getLogger(logName).info(String.format("%s", message), t);
35 }
36
37 @Override
38 public void warn(Object message) {
39 LoggerFactory.getLogger(logName).warn(String.format("%s", message));
40 }
41
42 @Override
43 public void warn(Object message, Throwable t) {
44 LoggerFactory.getLogger(logName).warn(String.format("%s", message), t);
45 }
46
47 @Override
48 public void error(Object message) {
49 LoggerFactory.getLogger(logName).error(String.format("%s", message));
50 }
51
52 @Override
53 public void error(Object message, Throwable t) {
54 LoggerFactory.getLogger(logName).error(String.format("%s", message), t);
55 }
56 }