本文整理汇总了Java中org.slf4j.Marker类的典型用法代码示例。如果您正苦于以下问题:Java Marker类的具体用法?Java Marker怎么用?Java Marker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Marker类属于org.slf4j包,在下文中一共展示了Marker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLoggingMarker
import org.slf4j.Marker; //导入依赖的package包/类
public Marker getLoggingMarker() {
// If we get more optional header fields, we should probably exclude them if they are empty.
Marker messageMarker =
append("messageId", messageId)
.and(append("partitionId", partitionId))
.and(append("partitioningKey", partitioningKey))
.and(append("offset", offset))
.and(append("messageId", messageId))
.and(append("correlationId", correlationId))
.and(append("requestCorrelationId", requestCorrelationId));
// Nota bene: without the toString the marker tries to convert the object into Json, which produces strange results
if (topic != null) {
messageMarker.add(append("topic", topic.toString()));
}
if (replyTo != null) {
messageMarker.add(append("replyTo", replyTo.toString()));
}
if (type != null) {
messageMarker.add(append("messageType", type.toString()));
}
return messageMarker;
}
示例2: decide
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) {
// cannot use logger.isEnabledFor(level), as it would cause a StackOverflowError by calling this filter again!
if(level.isGreaterOrEqual(logger.getEffectiveLevel()) && format != null) {
switch (level.toInt()) {
case Level.ERROR_INT:
errorCounter.increment();
break;
case Level.WARN_INT:
warnCounter.increment();
break;
case Level.INFO_INT:
infoCounter.increment();
break;
case Level.DEBUG_INT:
debugCounter.increment();
break;
case Level.TRACE_INT:
traceCounter.increment();
break;
}
}
return FilterReply.NEUTRAL;
}
示例3: matches
import org.slf4j.Marker; //导入依赖的package包/类
public boolean matches(ILoggingEvent event) {
Marker marker = event.getMarker();
if(marker != null) {
return matches(marker);
}
return false;
}
示例4: 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);
}
}
}
示例5: isTraceEnabled
import org.slf4j.Marker; //导入依赖的package包/类
public boolean isTraceEnabled(Marker marker) {
return isTraceEnabled();
}
示例6: isDebugEnabled
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public boolean isDebugEnabled(Marker arg0) {
return false;
}
示例7: debug
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void debug(final Marker marker, final String format, final Object arg) {
delegate.debug(marker, manipulateLogMessage(format), manipulateLogArguments(arg));
}
示例8: error
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void error(final Marker marker, final String format, final Object arg) {
delegate.error(marker, manipulateLogMessage(format), manipulateLogArguments(arg));
}
示例9: trace
import org.slf4j.Marker; //导入依赖的package包/类
public void trace(Marker marker, String msg) {
}
示例10: debug
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void debug(Marker marker, String s, Object o, Object o1)
{
underlying.debug(marker, s, o, o1);
}
示例11: warn
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void warn(final Marker marker, final String format, final Object arg1, final Object arg2) {
delegate.warn(marker, manipulateLogMessage(format), manipulateLogArguments(arg1, arg2));
}
示例12: debug
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void debug(Marker arg0, String arg1, Throwable arg2) {
}
示例13: warn
import org.slf4j.Marker; //导入依赖的package包/类
/**
* {@link #warn(org.slf4j.Marker, java.lang.String, java.lang.Throwable)} with a lambda message supplier.
*/
default void warn(Marker marker, Supplier<String> msgSupplier, Throwable t) {
doLog(marker, Level.WARN, msgSupplier, t);
}
示例14: debug
import org.slf4j.Marker; //导入依赖的package包/类
@Override
public void debug(Marker marker, String format, Object arg) {
if (shouldLog()) {
delegate.debug(marker, format, arg);
}
}
示例15: info
import org.slf4j.Marker; //导入依赖的package包/类
/**
* {@link #info(org.slf4j.Marker, java.lang.String)} with a lambda message supplier.
*/
default void info(Marker marker, Supplier<String> msgSupplier) {
doLog(marker, Level.INFO, msgSupplier, null);
}