本文整理汇总了Java中org.slf4j.Marker.hasReferences方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.hasReferences方法的具体用法?Java Marker.hasReferences怎么用?Java Marker.hasReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.slf4j.Marker
的用法示例。
在下文中一共展示了Marker.hasReferences方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populate
import org.slf4j.Marker; //导入方法依赖的package包/类
private void populate(Marker marker, List<DomainMarker> markers) {
if (marker instanceof DomainMarker) {
markers.add((DomainMarker)marker);
} else if(marker instanceof DeferredMdcMarker) {
DeferredMdcMarker deferredMdcMarker = (DeferredMdcMarker)marker;
for(DomainMarker mdcMarker : deferredMdcMarker.getMarkers()) {
markers.add(mdcMarker);
}
}
if(marker.hasReferences()) {
Iterator<Marker> iterator = marker.iterator();
while(iterator.hasNext()) {
populate(iterator.next(), markers);
}
}
}
示例2: add
import org.slf4j.Marker; //导入方法依赖的package包/类
@Override
public void add(Marker reference) {
if(reference instanceof LogstashMarker) {
// limit to one level to make things a bit less complicated
if(reference.hasReferences()) {
throw new IllegalArgumentException("Please do not nest markers in more than one level");
}
super.add(reference);
} else {
throw new IllegalArgumentException("Expected marker instance of " + LogstashMarker.class.getName());
}
}
示例3: populate
import org.slf4j.Marker; //导入方法依赖的package包/类
private void populate(Marker marker, List<DomainMarker> markers, boolean mdc) {
if (marker instanceof DomainMarker) {
DomainMarker domainMarker = (DomainMarker)marker;
if(mdc) {
DomainMarker parent = domainMarker.getParent(); // assume from mdc context
if(parent != null) {
markers.add(parent);
}
} else {
markers.add(domainMarker);
}
} else if(marker instanceof DeferredMdcMarker) {
DeferredMdcMarker deferredMdcMarker = (DeferredMdcMarker)marker;
for(DomainMarker mdcMarker : deferredMdcMarker.getMarkers()) {
markers.add(mdcMarker);
}
}
if(marker.hasReferences()) {
Iterator<Marker> iterator = marker.iterator();
while(iterator.hasNext()) {
populate(iterator.next(), markers, mdc);
}
}
}
示例4: matches
import org.slf4j.Marker; //导入方法依赖的package包/类
protected boolean matches(ILoggingEvent event) {
if (loggerName != null) {
if (!event.getLoggerName().equals(loggerName)) {
return false;
}
}
if (level != null) {
if (!event.getLevel().isGreaterOrEqual(level)) {
return false;
}
}
Marker marker = event.getMarker();
if (marker == null) {
return false;
}
if(key != null) {
if(qualifier != null) {
DomainMarker qualifiedMarker = find(qualifier, marker);
if (qualifiedMarker != null) {
Object value = getter(qualifiedMarker, key);
return matcher.matches(value);
}
} else {
if(matchMarker(marker)) {
return true;
}
if(marker.hasReferences()) {
Iterator<Marker> iterator = marker.iterator();
while(iterator.hasNext()) {
if(matchMarker(iterator.next())) {
return true;
}
}
}
}
}
return false;
}