當前位置: 首頁>>代碼示例>>Java>>正文


Java Marker類代碼示例

本文整理匯總了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;
}
 
開發者ID:Sixt,項目名稱:ja-micro,代碼行數:26,代碼來源:Metadata.java

示例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;
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:26,代碼來源:LogbackMetrics.java

示例3: matches

import org.slf4j.Marker; //導入依賴的package包/類
public boolean matches(ILoggingEvent event) {
	Marker marker = event.getMarker();
	if(marker != null) {
		return matches(marker);
	}
	
	return false;
}
 
開發者ID:skjolber,項目名稱:json-log-domain,代碼行數:9,代碼來源:AbstractMarkerMatcher.java

示例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);
    	}
   	}
}
 
開發者ID:skjolber,項目名稱:json-log-domain,代碼行數:28,代碼來源:ContainsMdcMarkerMatcher.java

示例5: isTraceEnabled

import org.slf4j.Marker; //導入依賴的package包/類
public boolean isTraceEnabled(Marker marker) {
    return isTraceEnabled();
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:4,代碼來源:OutputEventListenerBackedLogger.java

示例6: isDebugEnabled

import org.slf4j.Marker; //導入依賴的package包/類
@Override
public boolean isDebugEnabled(Marker arg0) {
    return false;
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:5,代碼來源:PersoniumCoreExceptionMapperTest.java

示例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));
}
 
開發者ID:yuweijun,項目名稱:cas-server-4.2.1,代碼行數:5,代碼來源:CasDelegatingLogger.java

示例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));
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:5,代碼來源:CasDelegatingLogger.java

示例9: trace

import org.slf4j.Marker; //導入依賴的package包/類
public void trace(Marker marker, String msg) {
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:3,代碼來源:OutputEventListenerBackedLogger.java

示例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);
}
 
開發者ID:BatchLabs,項目名稱:escalog,代碼行數:6,代碼來源:LogFmt.java

示例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));
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:5,代碼來源:CasDelegatingLogger.java

示例12: debug

import org.slf4j.Marker; //導入依賴的package包/類
@Override
public void debug(Marker arg0, String arg1, Throwable arg2) {
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:4,代碼來源:PersoniumCoreLogTest.java

示例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);
}
 
開發者ID:kwon37xi,項目名稱:slf4j-lambda,代碼行數:7,代碼來源:LambdaLogger.java

示例14: debug

import org.slf4j.Marker; //導入依賴的package包/類
@Override
public void debug(Marker marker, String format, Object arg) {
	if (shouldLog()) {
		delegate.debug(marker, format, arg);
	}
}
 
開發者ID:zhangjunfang,項目名稱:util,代碼行數:7,代碼來源:ThrottledSlf4jLogger.java

示例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);
}
 
開發者ID:kwon37xi,項目名稱:slf4j-lambda,代碼行數:7,代碼來源:LambdaLogger.java


注:本文中的org.slf4j.Marker類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。