操作ログオブジェクトを作成します。

@param logger
ロガー
@param testStep
テストステップ
@param messagePattern
メッセージパターン
@param params
メッセージパラメーター
@return 操作ログ
439395
public static LogRecord info(SitLogger logger, TestStep testStep, MessagePattern messagePattern,
            Object... params) {

        Object[] newParams = new Object[] { testStep.getItemName(), testStep.getLocator() };
        newParams = ArrayUtils.addAll(newParams, params);

        return info(logger, testStep, messagePattern.getPattern(), newParams);
    }
711974
public void debug(String format, Object arg1, Object arg2) {
        if (!logger.isDebugEnabled())
            return;

        if (instanceofLAL) {
            String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
        } else {
            logger.debug(format, arg1, arg2);
        }
    }
496357
@SuppressWarnings("PMD.UnusedPrivateMethod")
    private static void log(final int level,
                            @NonNull final String messageFormat,
                            @Nullable final Object... args) {
        if (shouldLog(level)) {
            Log.println(level, TAG, String.format(messageFormat, args));
        }
    }
306746
static int countArgumentPlaceholders2(final String messagePattern, final int[] indices) {
        if (messagePattern == null) {
            return 0;
        }
        final int length = messagePattern.length();
        int result = 0;
        boolean isEscaped = false;
        for (int i = 0; i < length - 1; i++) {
            final char curChar = messagePattern.charAt(i);
            if (curChar == ESCAPE_CHAR) {
                isEscaped = !isEscaped;
                indices[0] = -1; // escaping means fast path is not available...
                result++;
            } else if (curChar == DELIM_START) {
                if (!isEscaped && messagePattern.charAt(i + 1) == DELIM_STOP) {
                    indices[result] = i;
                    result++;
                    i++;
                }
                isEscaped = false;
            } else {
                isEscaped = false;
            }
        }
        return result;
    }
676210
@Override
	public String formatLogMsg(LogEvent logEvent) {
		LogMessageType      messageInfo  = logEvent.getLogEntry().getMessageInfo();
		LogMetadataInfoType metadataInfo = logEvent.getLogEntry().getMetadataInfo();
		LogRuntimeInfoType  runtimeInfo  = logEvent.getLogEntry().getRuntimeInfo();

		String integrationScenarioId   = metadataInfo.getIntegrationScenarioId();
		String contractId              = metadataInfo.getContractId();
		String logMessage              = messageInfo.getMessage();
		String serviceImplementation   = metadataInfo.getServiceImplementation();
		String componentId             = runtimeInfo.getComponentId();
		String endpoint                = metadataInfo.getEndpoint();
		String messageId               = runtimeInfo.getMessageId();
		String businessCorrelationId   = runtimeInfo.getBusinessCorrelationId();
		String payload                 = logEvent.getLogEntry().getPayload();
		String businessContextIdString = businessContextIdToString(runtimeInfo.getBusinessContextId());
		String extraInfoString         = extraInfoToString(logEvent.getLogEntry().getExtraInfo());
		String logEventName            = "logEvent-" + messageInfo.getLevel().toString().toLowerCase();

		StringBuffer stackTrace = new StringBuffer();
		LogMessageExceptionType lmeException = logEvent.getLogEntry().getMessageInfo().getException();
		if (lmeException != null) {
			String ex = lmeException.getExceptionClass();
			String msg = lmeException.getExceptionMessage();
			List<String> st = lmeException.getStackTrace();

			stackTrace.append('\n').append("Stacktrace=").append(ex).append(": ").append(msg);
			for (String stLine : st) {
				if (stLine.startsWith(CAUSE_EXCEPTION_HEADER)) {
					stackTrace.append("\n\n").append(stLine);
					
				} else {
					stackTrace.append("\n\t at ").append(stLine);
				}
			}
		}
		return MessageFormatter.arrayFormat(LOG_STRING, new String[] {logEventName, integrationScenarioId, contractId, logMessage, serviceImplementation, runtimeInfo.getHostName(), runtimeInfo.getHostIp(), componentId, endpoint, messageId, businessCorrelationId, businessContextIdString, extraInfoString, payload, stackTrace.toString(), logEventName}).getMessage();
	}
529081
@SuppressWarnings({"static-method", "checkstyle:regexp"})
	public void logDebugMessage(String message, Throwable cause) {
		Debug.println(message);
		if (cause != null) {
			Debug.printStackTrace(cause);
		}
	}
557932
public static String formatMessage(String msg, Object... params) {
		try {
			// required by MessageFormat, single quotes break string interpolation!
			msg = StringUtils.replace(msg, "'", "''");
			return StringUtils.isBlank(msg) ? "" : MessageFormat.format(msg, params);
		} catch (IllegalArgumentException e) {
			return msg;
		}
	}
240994
public void debug(String format, Object arg) {
        if (!logger.isDebugEnabled())
            return;

        if (instanceofLAL) {
            String formattedMessage = MessageFormatter.format(format, arg).getMessage();
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg }, null);
        } else {
            logger.debug(format, arg);
        }
    }
527285
@Override
    public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg,
            final Throwable t) {
        StackTraceElement element = null;
        if (fqcn != null) {
            element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace());
        }
        final StatusData data = new StatusData(element, level, msg, t, null);
        msgLock.lock();
        try {
            messages.add(data);
        } finally {
            msgLock.unlock();
        }
        // LOG4J2-1813 if system property "log4j2.debug" is defined, all status logging is enabled
        if (isDebugPropertyEnabled()) {
            logger.logMessage(fqcn, level, marker, msg, t);
        } else {
            if (listeners.size() > 0) {
                for (final StatusListener listener : listeners) {
                    if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
                        listener.log(data);
                    }
                }
            } else {
                logger.logMessage(fqcn, level, marker, msg, t);
            }
        }
    }
1280621
public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
        return INSTANCE.matchesPattern(input, pattern, message);
    }
1309985
public void init(TimeFormatType timeFormat, String datePattern, String numberPattern) {
		// Null
		final Stringifier nullStringifier = registerNullStringifier();

		// Default
		compositeStringifier.setDefaultStringifier(new BaseStringifier(nullStringifier));

		// String
		final Stringifier<String> stringStringifier = registerStringStringifier(nullStringifier);

		// Disabled String
		compositeStringifier.add(String.class, NONE_SUBTYPE, NoneStringifier.getInstance());

		// Integer
		final Stringifier<Integer> integerStringifier = new BaseStringifier<Integer>(nullStringifier) {

			@Override
			protected boolean isValid(Integer l) {
				return super.isValid(l) && !(l == Integer.MIN_VALUE || l == Integer.MAX_VALUE);
			}
		};
		compositeStringifier.add(Integer.class, integerStringifier);
		compositeStringifier.add(Integer.TYPE, integerStringifier);

		// Long
		final Stringifier<Long> longStringifier = new BaseStringifier<Long>(nullStringifier) {
			@Override
			protected boolean isValid(Long l) {
				return super.isValid(l) && !(l == Long.MIN_VALUE || l == Long.MAX_VALUE);
			}
		};
		registerLongStringifier(null, longStringifier);

		// Float
		final Stringifier<Float> floatStringifier = new NumberStringifier<Float>(nullStringifier, numberPattern) {
			@Override
			protected boolean isValid(Float f) {
				return super.isValid(f) && !(
					f == Float.MIN_VALUE || f == Float.MAX_VALUE || f.isInfinite() || f.isNaN());
			}
		};
		compositeStringifier.add(Float.class, floatStringifier);
		compositeStringifier.add(Float.TYPE, floatStringifier);

		// Double
		final Stringifier<Double> doubleStringifier = new NumberStringifier<Double>(nullStringifier, numberPattern) {
			@Override
			protected boolean isValid(Double d) {
				return super.isValid(d) && !(
					d == Double.MIN_VALUE || d == Double.MAX_VALUE || d.isInfinite() || d.isNaN());
			}
		};
		registerDoubleStringifier(null, doubleStringifier);

		// Enum
		final Stringifier<Enum> enumStringifier = new BaseStringifier<Enum>(nullStringifier) {
			@Override
			protected String doToString(Enum e) {
				return stringStringifier.toString(e.name());
			}
		};
		compositeStringifier.add(Enum.class, enumStringifier);
		compositeStringifier.add(SimonType.class, enumStringifier);
		compositeStringifier.add(SimonState.class, enumStringifier);
		compositeStringifier.add(HtmlResourceType.class, enumStringifier);

		// Date
		final Stringifier<java.util.Date> dateStringifier = new DateStringifier(nullStringifier, stringStringifier, datePattern);
		compositeStringifier.add(Date.class, dateStringifier);
		final LongDateStringifier longDateStringifier = new LongDateStringifier(nullStringifier, dateStringifier);
		registerLongStringifier(DATE_SUBTYPE, longDateStringifier);

		// Time
		final LongTimeStringifier longTimeStringifier = new LongTimeStringifier(nullStringifier, longStringifier, stringStringifier, timeFormat);
		registerLongStringifier(TIME_SUBTYPE, longTimeStringifier);
		final DoubleTimeStringifier doubleTimeStringifier = new DoubleTimeStringifier(nullStringifier, doubleStringifier, stringStringifier, timeFormat);
		registerDoubleStringifier(TIME_SUBTYPE, doubleTimeStringifier);

		// Boolean
		final Stringifier<Boolean> booleanStringifier = new BaseStringifier<Boolean>(nullStringifier) {
			@Override
			protected String doToString(Boolean b) {
				return stringStringifier.toString(b.toString());
			}
		};
		compositeStringifier.add(Boolean.class, booleanStringifier);
		compositeStringifier.add(Boolean.TYPE, booleanStringifier);
	}
155448
public static void info(String msg, Object... args) {
		if (BaseProcessor.JUNIT_TEST_MODE) {
			logger.info(String.format(msg, args));
		}

		if (!BaseProcessor.JUNIT_TEST_MODE && BaseProcessor.DEBUG_MODE)
			messager.printMessage(Diagnostic.Kind.NOTE, String.format(msg, args));
		
	}
1160960
protected String createAndlogStackTrace(Failure failure) {
        StringBuilder sb = new StringBuilder();

        if (failure.getMessage() != null && !failure.getMessage().isEmpty()) {
            sb.append("Failure message: ").append(failure.getMessage());
        }

        if (failure.getException() != null) {
            sb.append("\n\n");
            sb.append(failure.getException().getClass().getCanonicalName()).append(": ").append(failure.getMessage()).append("\n");

            for (StackTraceElement ste : failure.getException().getStackTrace()) {
                sb.append("\tat ").append(ste.getClassName()).append(".").append(ste.getMethodName()).
                    append("(").append(ste.getFileName()).append(":").append(ste.getLineNumber()).append(")\n");

                if (!fullStackTraces && ste.getClassName().equals(failure.getDescription().getClassName())) {
                    sb.append("\t...\n");
                    break;
                }
            }

            if (fullStackTraces && failure.getException().getCause() != null) {
                sb.append("Cause: ").append(failure.getException().getCause().getMessage()).append("\n");

                for (StackTraceElement ste : failure.getException().getCause().getStackTrace()) {
                    sb.append("\tat ").append(ste.getClassName()).append(".").append(ste.getMethodName()).
                        append("(").append(ste.getFileName()).append(":").append(ste.getLineNumber()).append(")\n");
                }
            }

            LOGGER.info("\n" + failure.getTestHeader() + "\n" + sb.toString());
        }

        return sb.toString();
    }
322936
@Override
    public void debug(String format, Object arg) {
        if (logger.isDebugEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.debug(ft.getMessage(), ft.getThrowable());
        }
    }
17693
public void trace(String format, Object... args) {
        if (!logger.isTraceEnabled())
            return;

        if (instanceofLAL) {
            String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage();
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
        } else {
            logger.trace(format, args);
        }
    }
737817
protected String internalFormatMessage(String pattern, Object[] args) {
        /* todo: perf -- could the MessageFormat objects be cached? */
        MessageFormat format = new MessageFormat(pattern);
        String msg = format.format(args).toString();
        return msg;
    }
1130013
public static void log(Logger logger,
                           Level level,
                           String message,
                           Object parameter) {
        log(logger, level, message, new Object[] { parameter });
    }