@Test public void invalidFormatSpecifier() { assertThat(format("Hello %!", "tinylog")).isEqualTo("Hello %!"); assertThat(systemStream.consumeErrorOutput()).containsOnlyOnce("WARN").containsOnlyOnce("Hello %!"); }
@Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments); }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments);  }