/** * Checks whether this data object contains a <code>LoggingData</code> object. * * @param data * the <code>InvocationSequenceData</code> object. * @return whether this data object contains a logging data object. */ public static boolean hasLoggingData(InvocationSequenceData data) { return null != data.getLoggingData(); }
/** * Returns if the given {@link InvocationSequenceData} should be removed due to no data. Can be * in case of * <ul> * <li>the wrapping of the prepared SQL statements. * <li>having an empty logging element (if the logging occurred with a lower logging level than * the configuration) * <li>running remote sensor that provided no span * <li>having invocation sensor without any other sensor on the method * </ul> * * @param invocationSequenceData * {@link InvocationSequenceData} to check. * * @return True if the invocation should be removed. */ private boolean removeDueToNoData(InvocationSequenceData invocationSequenceData) { return (null == invocationSequenceData.getTimerData()) && (null == invocationSequenceData.getSqlStatementData()) && (null == invocationSequenceData.getLoggingData()) && (null == invocationSequenceData.getSpanIdent()) && CollectionUtils.isEmpty(invocationSequenceData.getExceptionSensorDataObjects()); }
secondary = invocationSequenceData.getExceptionSensorDataObjects().get(0); if (null != invocationSequenceData.getLoggingData()) { secondary = invocationSequenceData.getLoggingData();
/** * {@inheritDoc} */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { Object firstElement = ((StructuredSelection) HandlerUtil.getCurrentSelection(event)).getFirstElement(); if (firstElement instanceof LoggingData) { LoggingData loggingData = (LoggingData) firstElement; ClipboardUtil.textToClipboard(HandlerUtil.getActiveShell(event).getDisplay(), loggingData.getMessage()); } else if (firstElement instanceof InvocationSequenceData) { LoggingData loggingData = ((InvocationSequenceData) firstElement).getLoggingData(); ClipboardUtil.textToClipboard(HandlerUtil.getActiveShell(event).getDisplay(), loggingData.getMessage()); } return null; }
assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getLoggingData(), is(loggingData));
LoggingData loggingData = data.getLoggingData(); styledString.append("[" + loggingData.getLevel().toUpperCase() + "] "); styledString.append(loggingData.getMessage());
/** * Clones invocation sequence. This method returns new object exactly same as the original * object, but with out nested sequences set. * * @return Cloned invocation sequence. */ public InvocationSequenceData getClonedInvocationSequence() { InvocationSequenceData clone = new InvocationSequenceData(this.getTimeStamp(), this.getPlatformIdent(), this.getSensorTypeIdent(), this.getMethodIdent()); clone.setId(this.getId()); clone.setSpanIdent(this.getSpanIdent()); clone.setChildCount(this.getChildCount()); clone.setDuration(this.getDuration()); clone.setEnd(this.getEnd()); clone.setNestedSequences(Collections.<InvocationSequenceData> emptyList()); clone.setParameterContentData(this.getParameterContentData()); clone.setParentSequence(this.getParentSequence()); clone.setPosition(this.getPosition()); clone.setSqlStatementData(this.getSqlStatementData()); clone.setTimerData(this.getTimerData()); clone.setExceptionSensorDataObjects(this.getExceptionSensorDataObjects()); clone.setStart(this.getStart()); clone.setNestedSqlStatements(this.isNestedSqlStatements()); clone.setNestedExceptions(this.isNestedExceptions()); clone.setLoggingData(this.getLoggingData()); clone.setApplicationId(this.getApplicationId()); clone.setBusinessTransactionId(this.getBusinessTransactionId()); return clone; }