下面列出了怎么用org.slf4j.helpers.NOPMDCAdapter的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Currently this method always returns an instance of
* {@link StaticMDCBinder}.
* @return
*/
public MDCAdapter getMDCA() {
try {
return (MDCAdapter) Class.forName(getMDCAdapterClassStr()).newInstance();
} catch (Exception e) { // NOSONAR we can't log here as we are actually instantiating log here
System.err.println("Unable to instantiate mdc adapter " + getMDCAdapterClassStr()); // NOSONAR
e.printStackTrace(); // NOSONAR
return new NOPMDCAdapter();
}
}
public String getMDCAdapterClassStr() {
return NOPMDCAdapter.class.getName();
}
@Override
public void initialize() {
loggerFactory = new DefaultLoggerFactory();
markerFactory = new BasicMarkerFactory();
mdcAdapter = new NOPMDCAdapter();
}
public String getMDCAdapterClassStr() {
return NOPMDCAdapter.class.getName();
}
/**
* Currently this method always returns an instance of
* {@link StaticMDCBinder}.
*/
public MDCAdapter getMDCA() {
return new NOPMDCAdapter();
}
/**
* Currently this method always returns an instance of
* {@link StaticMDCBinder}.
*/
public MDCAdapter getMDCA() {
return new NOPMDCAdapter();
}