当前位置: 首页>>代码示例>>Java>>正文


Java Trace.trace方法代码示例

本文整理汇总了Java中com.evolveum.midpoint.util.logging.Trace.trace方法的典型用法代码示例。如果您正苦于以下问题:Java Trace.trace方法的具体用法?Java Trace.trace怎么用?Java Trace.trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.evolveum.midpoint.util.logging.Trace的用法示例。


在下文中一共展示了Trace.trace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: log

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
@Override
public void log(Class<?> clazz, String method, Level level, String message, Throwable ex) {
	Trace LOGGER = TraceManager.getTrace(clazz);
	//Mark all messages from ICF as ICF
	Marker m = MarkerFactory.getMarker("ICF");
	
	//Translate ICF logging into slf4j
	// OK    -> trace
	// INFO  -> debug
	// WARN  -> warn
	// ERROR -> error
	if (Level.OK.equals(level)) {
		if (null == ex) {
			LOGGER.trace(m, "method: {} msg:{}", method, message);
		} else {
			LOGGER.trace(m, "method: {} msg:{}", new Object[] { method, message }, ex);
		}
	} else if (Level.INFO.equals(level)) {
		if (null == ex) {
			LOGGER.debug(m, "method: {} msg:{}", method, message);
		} else {
			LOGGER.debug(m, "method: {} msg:{}", new Object[] { method, message }, ex);
		}
	} else if (Level.WARN.equals(level)) {
		if (null == ex) {
			LOGGER.warn(m, "method: {} msg:{}", method, message);
		} else {
			LOGGER.warn(m, "method: {} msg:{}", new Object[] { method, message }, ex);
		}
	} else if (Level.ERROR.equals(level)) {
		if (null == ex) {
			LOGGER.error(m, "method: {} msg:{}", method, message);
		} else {
			LOGGER.error(m, "method: {} msg:{}", new Object[] { method, message }, ex);
		}
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:38,代码来源:Slf4jConnectorLogger.java

示例2: traceContext

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static <F extends ObjectType> void traceContext(Trace logger, String activity, String phase, 
boolean important,  LensContext<F> context, boolean showTriples) throws SchemaException {
     if (logger.isTraceEnabled()) {
     	logger.trace("Lens context:\n"+
         		"---[ {} context {} ]--------------------------------\n"+
         		"{}\n",
		activity, phase, context.dump(showTriples));
     }
 }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:LensUtil.java

示例3: logStart

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
protected void logStart(Trace LOGGER, Event event, EventHandlerType eventHandlerType, Object additionalData) {
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Starting processing event " + event + " with handler " +
                eventHandlerType.getClass() + " (name: " + eventHandlerType.getName() +
                (additionalData != null ? (", parameters: " + additionalData) :
                                         (", configuration: " + eventHandlerType)) +
                ")");
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:BaseHelper.java

示例4: logStart

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
protected void logStart(Trace LOGGER, Event event, EventHandlerType eventHandlerType, Object additionalData) {
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Starting processing event " + event.shortDump() + " with handler " +
        		getHumanReadableHandlerDescription(eventHandlerType) + "\n  parameters: " +
        		(additionalData != null ? ("\n  parameters: " + additionalData) :
                    ("\n  configuration: " + eventHandlerType)));
                
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:BaseHandler.java

示例5: staticLogStart

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static void staticLogStart(Trace LOGGER, Event event, String description, Object additionalData) {
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Starting processing event " + event + " with handler " +
                description +
                (additionalData != null ? (", parameters: " + additionalData) : ""));
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:BaseHandler.java

示例6: logAllLevels

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
private void logAllLevels(Trace logger, String subsystemName) {
	String message = MARKER+" "+subsystemName;
	String previousSubsystem = MidpointInterceptor.swapSubsystemMark(subsystemName);
	logger.trace(message);
	logger.debug(message);
	logger.info(message);
	logger.warn(message);
	logger.error(message);
	MidpointInterceptor.swapSubsystemMark(previousSubsystem);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:11,代码来源:LogfileTestTailer.java

示例7: enter

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static <T extends AbstractCache> T enter(ThreadLocal<T> cacheThreadLocal, Class<T> cacheClass, Trace logger) {
    T inst = cacheThreadLocal.get();
    logger.trace("Cache: ENTER for thread {}, {}", Thread.currentThread().getName(), inst);
    if (inst == null) {
        logger.trace("Cache: creating for thread {}",Thread.currentThread().getName());
        try {
            inst = cacheClass.newInstance();
        } catch (InstantiationException|IllegalAccessException e) {
            throw new SystemException("Couldn't instantiate cache: " + e.getMessage(), e);
        }
        cacheThreadLocal.set(inst);
    }
    inst.incrementEntryCount();
    return inst;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:16,代码来源:AbstractCache.java

示例8: exit

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static <T extends AbstractCache> T exit(ThreadLocal<T> cacheThreadLocal, Trace logger) {
    T inst = cacheThreadLocal.get();
    logger.trace("Cache: EXIT for thread {}, {}", Thread.currentThread().getName(), inst);
    if (inst == null || inst.getEntryCount() == 0) {
        logger.error("Cache: Attempt to exit cache that does not exist or has entry count 0: {}", inst);
        cacheThreadLocal.set(null);
    } else {
        inst.decrementEntryCount();
        if (inst.getEntryCount() <= 0) {
            destroy(cacheThreadLocal, logger);
        }
    }
    return inst;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:15,代码来源:AbstractCache.java

示例9: destroy

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static <T extends AbstractCache> void destroy(ThreadLocal<T> cacheThreadLocal, Trace logger) {
    T inst = cacheThreadLocal.get();
    if (inst != null) {
        logger.trace("Cache: DESTROY for thread {}", Thread.currentThread().getName());
        cacheThreadLocal.set(null);
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:AbstractCache.java

示例10: traceContext

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public static <F extends ObjectType> void traceContext(Trace logger, String activity, String phase,
boolean important,  LensContext<F> context, boolean showTriples) throws SchemaException {
     if (logger.isTraceEnabled()) {
     	logger.trace("Lens context:\n"+
         		"---[ {} context {} ]--------------------------------\n"+
         		"{}\n",
		activity, phase, context.dump(showTriples));
     }
 }
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:10,代码来源:LensUtil.java

示例11: logStart

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
protected void logStart(Trace LOGGER, Event event, EventHandlerType eventHandlerType, Object additionalData) {
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Starting processing event " + event.shortDump() + " with handler " +
        		getHumanReadableHandlerDescription(eventHandlerType) + "\n  parameters: " +
        		(additionalData != null ? ("\n  parameters: " + additionalData) :
                    ("\n  configuration: " + eventHandlerType)));

    }
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:10,代码来源:BaseHandler.java

示例12: selectorMatches

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
@Override
public <O extends ObjectType> boolean selectorMatches(ObjectSelectorType objectSelector,
		PrismObject<O> object, Trace logger, String logMessagePrefix) throws SchemaException {
	if (objectSelector == null) {
		logger.trace("{} null object specification", logMessagePrefix);
		return false;
	}
	
	SearchFilterType specFilterType = objectSelector.getFilter();
	ObjectReferenceType specOrgRef = objectSelector.getOrgRef();
	QName specTypeQName = objectSelector.getType();     // now it does not matter if it's unqualified
	PrismObjectDefinition<O> objectDefinition = object.getDefinition();
	
	// Type
	if (specTypeQName != null && !QNameUtil.match(specTypeQName, objectDefinition.getTypeName())) {
		logger.trace("{} type mismatch, expected {}, was {}", logMessagePrefix, specTypeQName, objectDefinition.getTypeName());
		return false;
	}
	
	// Filter
	if (specFilterType != null) {
		ObjectFilter specFilter = QueryJaxbConvertor.createObjectFilter(object.getCompileTimeClass(), specFilterType, object.getPrismContext());
           ObjectTypeUtil.normalizeFilter(specFilter);		//  we assume object is already normalized
           if (specFilter != null) {
			ObjectQueryUtil.assertPropertyOnly(specFilter, logMessagePrefix + " filter is not property-only filter");
		}
		try {
			if (!ObjectQuery.match(object, specFilter, matchingRuleRegistry)) {
				logger.trace("{} object OID {}", logMessagePrefix, object.getOid() );
				return false;
			}
		} catch (SchemaException ex) {
			throw new SchemaException(logMessagePrefix + "could not apply for " + object + ": "
					+ ex.getMessage(), ex);
		}
	}
		
	// Org	
	if (specOrgRef != null) {
		if (!isDescendant(object, specOrgRef.getOid())) {
			LOGGER.trace("{} object OID {} (org={})",
					logMessagePrefix, object.getOid(), specOrgRef.getOid());
			return false;
		}			
	}
	
	return true;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:49,代码来源:SqlRepositoryServiceImpl.java

示例13: logEnd

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
public void logEnd(Trace LOGGER, Event event, EventHandlerType eventHandlerType, boolean result) {
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Finishing processing event " + event + " result = " + result);
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:6,代码来源:BaseHelper.java

示例14: createTriggers

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
@NotNull
public static List<TriggerType> createTriggers(int escalationLevel, Date workItemCreateTime,
		Date workItemDeadline, List<WorkItemTimedActionsType> timedActionsList,
		PrismContext prismContext, Trace logger, @Nullable String workItemId, @NotNull String handlerUri)
		throws SchemaException {
	List<TriggerType> triggers = new ArrayList<>();
	for (WorkItemTimedActionsType timedActionsEntry : timedActionsList) {
		Integer levelFrom;
		Integer levelTo;
		if (timedActionsEntry.getEscalationLevelFrom() == null && timedActionsEntry.getEscalationLevelTo() == null) {
			levelFrom = levelTo = 0;
		} else {
			levelFrom = timedActionsEntry.getEscalationLevelFrom();
			levelTo = timedActionsEntry.getEscalationLevelTo();
		}
		if (levelFrom != null && escalationLevel < levelFrom) {
			logger.trace("Current escalation level is before 'escalationFrom', skipping timed actions {}", timedActionsEntry);
			continue;
		}
		if (levelTo != null && escalationLevel > levelTo) {
			logger.trace("Current escalation level is after 'escalationTo', skipping timed actions {}", timedActionsEntry);
			continue;
		}
		// TODO evaluate the condition
		List<TimedActionTimeSpecificationType> timeSpecifications = CloneUtil.cloneCollectionMembers(timedActionsEntry.getTime());
		if (timeSpecifications.isEmpty()) {
			timeSpecifications.add(new TimedActionTimeSpecificationType());
		}
		for (TimedActionTimeSpecificationType timeSpec : timeSpecifications) {
			if (timeSpec.getValue().isEmpty()) {
				timeSpec.getValue().add(XmlTypeConverter.createDuration(0));
			}
			for (Duration duration : timeSpec.getValue()) {
				XMLGregorianCalendar mainTriggerTime = computeTriggerTime(duration, timeSpec.getBase(),
						workItemCreateTime, workItemDeadline);
				TriggerType mainTrigger = createTrigger(mainTriggerTime, timedActionsEntry.getActions(), null, prismContext, workItemId, handlerUri);
				triggers.add(mainTrigger);
				List<Pair<Duration, AbstractWorkItemActionType>> notifyInfoList = getNotifyBefore(timedActionsEntry);
				for (Pair<Duration, AbstractWorkItemActionType> notifyInfo : notifyInfoList) {
					XMLGregorianCalendar notifyTime = (XMLGregorianCalendar) mainTriggerTime.clone();
					notifyTime.add(notifyInfo.getKey().negate());
					TriggerType notifyTrigger = createTrigger(notifyTime, null, notifyInfo, prismContext, workItemId, handlerUri);
					triggers.add(notifyTrigger);
				}
			}
		}
	}
	return triggers;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:50,代码来源:WfContextUtil.java

示例15: selectorMatches

import com.evolveum.midpoint.util.logging.Trace; //导入方法依赖的package包/类
@Override
public <O extends ObjectType> boolean selectorMatches(ObjectSelectorType objectSelector,
		PrismObject<O> object, ObjectFilterExpressionEvaluator filterEvaluator, Trace logger, String logMessagePrefix) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, SecurityViolationException {
	if (objectSelector == null) {
		logger.trace("{} null object specification", logMessagePrefix);
		return false;
	}

	SearchFilterType specFilterType = objectSelector.getFilter();
	ObjectReferenceType specOrgRef = objectSelector.getOrgRef();
	QName specTypeQName = objectSelector.getType();     // now it does not matter if it's unqualified
	PrismObjectDefinition<O> objectDefinition = object.getDefinition();

	// Type
	if (specTypeQName != null && !QNameUtil.match(specTypeQName, objectDefinition.getTypeName())) {
		if (LOGGER.isTraceEnabled()) {
			logger.trace("{} type mismatch, expected {}, was {}", 
					logMessagePrefix, PrettyPrinter.prettyPrint(specTypeQName), PrettyPrinter.prettyPrint(objectDefinition.getTypeName()));
		}
		return false;
	}

	// Subtype
	String specSubtype = objectSelector.getSubtype();
	if (specSubtype != null) {
		Collection<String> actualSubtypeValues = ObjectTypeUtil.getSubtypeValues(object);
		if (!actualSubtypeValues.contains(specSubtype)) {
			logger.trace("{} subtype mismatch, expected {}, was {}", logMessagePrefix, specSubtype, actualSubtypeValues);
			return false;
		}
	}

	// Filter
	if (specFilterType != null) {
		ObjectFilter specFilter = QueryJaxbConvertor.createObjectFilter(object.getCompileTimeClass(), specFilterType, object.getPrismContext());
		if (filterEvaluator != null) {
			specFilter = filterEvaluator.evaluate(specFilter);
		}
           ObjectTypeUtil.normalizeFilter(specFilter);		//  we assume object is already normalized
           if (specFilter != null) {
			ObjectQueryUtil.assertPropertyOnly(specFilter, logMessagePrefix + " filter is not property-only filter");
		}
		try {
			if (!ObjectQuery.match(object, specFilter, matchingRuleRegistry)) {
				logger.trace("{} object OID {}", logMessagePrefix, object.getOid() );
				return false;
			}
		} catch (SchemaException ex) {
			throw new SchemaException(logMessagePrefix + "could not apply for " + object + ": "
					+ ex.getMessage(), ex);
		}
	}

	// Org
	if (specOrgRef != null) {
		if (!isDescendant(object, specOrgRef.getOid())) {
			LOGGER.trace("{} object OID {} (org={})",
					logMessagePrefix, object.getOid(), specOrgRef.getOid());
			return false;
		}
	}

	return true;
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:65,代码来源:SqlRepositoryServiceImpl.java


注:本文中的com.evolveum.midpoint.util.logging.Trace.trace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。