作为下面的类Log4jImpl,我想知道它的初始化(类初始化不是对象),是否会导致org.apache.log4j.Level
和org.apache.log4j.Logger
被初始化?
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
public class Log4jImpl{
private static final String FQCN = Log4jImpl.class.getName();
private Logger log;
public Log4jImpl(String clazz) {
log = Logger.getLogger(clazz);
}
public boolean isDebugEnabled() {
return log.isDebugEnabled();
}
public boolean isTraceEnabled() {
return log.isTraceEnabled();
}
public void error(String s, Throwable e) {
log.log(FQCN, Level.ERROR, s, e);
}
public void error(String s) {
log.log(FQCN, Level.ERROR, s, null);
}
public void debug(String s) {
log.log(FQCN, Level.DEBUG, s, null);
}
public void trace(String s) {
log.log(FQCN, Level.TRACE, s, null);
}
public void warn(String s) {
log.log(FQCN, Level.WARN, s, null);
}
}