/** * Construct a <code>ElasticsearchException</code> with the specified detail message. * * The message can be parameterized using <code>{}</code> as placeholders for the given * arguments * * @param msg the detail message * @param args the arguments for the message */ public ElasticsearchException(String msg, Object... args) { super(LoggerMessageFormat.format(msg, args)); }
safeObjectAppend(sbuf, o); } else { booleanArrayAppend(sbuf, (boolean[]) o); } else if (o instanceof byte[]) { byteArrayAppend(sbuf, (byte[]) o); } else if (o instanceof char[]) { charArrayAppend(sbuf, (char[]) o); } else if (o instanceof short[]) { shortArrayAppend(sbuf, (short[]) o); } else if (o instanceof int[]) { intArrayAppend(sbuf, (int[]) o); } else if (o instanceof long[]) { longArrayAppend(sbuf, (long[]) o); } else if (o instanceof float[]) { floatArrayAppend(sbuf, (float[]) o); } else if (o instanceof double[]) { doubleArrayAppend(sbuf, (double[]) o); } else { objectArrayAppend(sbuf, (Object[]) o, seen);
if (isEscapedDelimiter(messagePattern, j)) { if (!isDoubleEscaped(messagePattern, j)) { deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2; deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2;
private static void objectArrayAppend(StringBuilder sbuf, Object[] a, Set<Object[]> seen) { sbuf.append('['); if (!seen.contains(a)) { seen.add(a); final int len = a.length; for (int i = 0; i < len; i++) { deeplyAppendParameter(sbuf, a[i], seen); if (i != len - 1) sbuf.append(", "); } // allow repeats in siblings seen.remove(a); } else { sbuf.append("..."); } sbuf.append(']'); }
private static void objectArrayAppend(StringBuilder sbuf, Object[] a, Set<Object[]> seen) { sbuf.append('['); if (!seen.contains(a)) { seen.add(a); final int len = a.length; for (int i = 0; i < len; i++) { deeplyAppendParameter(sbuf, a[i], seen); if (i != len - 1) sbuf.append(", "); } // allow repeats in siblings seen.remove(a); } else { sbuf.append("..."); } sbuf.append(']'); }
safeObjectAppend(sbuf, o); } else { booleanArrayAppend(sbuf, (boolean[]) o); } else if (o instanceof byte[]) { byteArrayAppend(sbuf, (byte[]) o); } else if (o instanceof char[]) { charArrayAppend(sbuf, (char[]) o); } else if (o instanceof short[]) { shortArrayAppend(sbuf, (short[]) o); } else if (o instanceof int[]) { intArrayAppend(sbuf, (int[]) o); } else if (o instanceof long[]) { longArrayAppend(sbuf, (long[]) o); } else if (o instanceof float[]) { floatArrayAppend(sbuf, (float[]) o); } else if (o instanceof double[]) { doubleArrayAppend(sbuf, (double[]) o); } else { objectArrayAppend(sbuf, (Object[]) o, seen);
/** * Construct a <code>ElasticsearchException</code> with the specified detail message * and nested exception. * * The message can be parameterized using <code>{}</code> as placeholders for the given * arguments * * @param msg the detail message * @param cause the nested exception * @param args the arguments for the message */ public ElasticsearchException(String msg, Throwable cause, Object... args) { super(LoggerMessageFormat.format(msg, args), cause); }
if (isEscapedDelimiter(messagePattern, j)) { if (!isDoubleEscaped(messagePattern, j)) { deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2; deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2;
private static void objectArrayAppend(StringBuilder sbuf, Object[] a, Set<Object[]> seen) { sbuf.append('['); if (!seen.contains(a)) { seen.add(a); final int len = a.length; for (int i = 0; i < len; i++) { deeplyAppendParameter(sbuf, a[i], seen); if (i != len - 1) sbuf.append(", "); } // allow repeats in siblings seen.remove(a); } else { sbuf.append("..."); } sbuf.append(']'); }
safeObjectAppend(sbuf, o); } else { booleanArrayAppend(sbuf, (boolean[]) o); } else if (o instanceof byte[]) { byteArrayAppend(sbuf, (byte[]) o); } else if (o instanceof char[]) { charArrayAppend(sbuf, (char[]) o); } else if (o instanceof short[]) { shortArrayAppend(sbuf, (short[]) o); } else if (o instanceof int[]) { intArrayAppend(sbuf, (int[]) o); } else if (o instanceof long[]) { longArrayAppend(sbuf, (long[]) o); } else if (o instanceof float[]) { floatArrayAppend(sbuf, (float[]) o); } else if (o instanceof double[]) { doubleArrayAppend(sbuf, (double[]) o); } else { objectArrayAppend(sbuf, (Object[]) o, seen);
public static String format(final String messagePattern, final Object... argArray) { return format(null, messagePattern, argArray); }
if (isEscapedDelimiter(messagePattern, j)) { if (!isDoubleEscaped(messagePattern, j)) { deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2; deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2;
private static void objectArrayAppend(StringBuilder sbuf, Object[] a, Set<Object[]> seen) { sbuf.append('['); if (!seen.contains(a)) { seen.add(a); final int len = a.length; for (int i = 0; i < len; i++) { deeplyAppendParameter(sbuf, a[i], seen); if (i != len - 1) sbuf.append(", "); } // allow repeats in siblings seen.remove(a); } else { sbuf.append("..."); } sbuf.append(']'); }
safeObjectAppend(sbuf, o); } else { booleanArrayAppend(sbuf, (boolean[]) o); } else if (o instanceof byte[]) { byteArrayAppend(sbuf, (byte[]) o); } else if (o instanceof char[]) { charArrayAppend(sbuf, (char[]) o); } else if (o instanceof short[]) { shortArrayAppend(sbuf, (short[]) o); } else if (o instanceof int[]) { intArrayAppend(sbuf, (int[]) o); } else if (o instanceof long[]) { longArrayAppend(sbuf, (long[]) o); } else if (o instanceof float[]) { floatArrayAppend(sbuf, (float[]) o); } else if (o instanceof double[]) { doubleArrayAppend(sbuf, (double[]) o); } else { objectArrayAppend(sbuf, (Object[]) o, seen);
@SuppressLoggerChecks(reason = "safely delegates to logger") void deprecated(final Set<ThreadContext> threadContexts, final String message, final boolean log, final Object... params) { final Iterator<ThreadContext> iterator = threadContexts.iterator(); if (iterator.hasNext()) { final String formattedMessage = LoggerMessageFormat.format(message, params); final String warningHeaderValue = formatWarning(formattedMessage); assert WARNING_HEADER_PATTERN.matcher(warningHeaderValue).matches(); assert extractWarningValueFromWarningHeader(warningHeaderValue).equals(escapeAndEncode(formattedMessage)); while (iterator.hasNext()) { try { final ThreadContext next = iterator.next(); next.addResponseHeader("Warning", warningHeaderValue, DeprecationLogger::extractWarningValueFromWarningHeader); } catch (final IllegalStateException e) { // ignored; it should be removed shortly } } } if (log) { logger.warn(message, params); } }
if (isEscapedDelimiter(messagePattern, j)) { if (!isDoubleEscaped(messagePattern, j)) { deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2; deeplyAppendParameter(sbuf, argArray[L], new HashSet<Object[]>()); i = j + 2;
/** * Construct a <code>ElasticsearchException</code> with the specified detail message. * * The message can be parameterized using <code>{}</code> as placeholders for the given * arguments * * @param msg the detail message * @param args the arguments for the message */ public ElasticsearchException(String msg, Object... args) { super(LoggerMessageFormat.format(msg, args)); }
/** * Construct a <code>ElasticsearchException</code> with the specified detail message. * * The message can be parameterized using <code>{}</code> as placeholders for the given * arguments * * @param msg the detail message * @param args the arguments for the message */ public ElasticsearchException(String msg, Object... args) { super(LoggerMessageFormat.format(msg, args)); }
/** * Construct a <code>ElasticsearchException</code> with the specified detail message. * * The message can be parameterized using <code>{}</code> as placeholders for the given * arguments * * @param msg the detail message * @param args the arguments for the message */ public ElasticsearchException(String msg, Object... args) { super(LoggerMessageFormat.format(msg, args)); }
UnsupportedQueryException(Query unsupportedQuery) { super(LoggerMessageFormat.format("no query terms can be extracted from query [{}]", unsupportedQuery)); this.unsupportedQuery = unsupportedQuery; }