@Test public void testNestedMessagesSeperator() { ExceptionMessageConverter converter = new ExceptionMessageConverter(); converter.setOptionList(Arrays.asList("1", "4", "[", " ! ")); LoggerContext context = new LoggerContext(); converter.setContext(context); converter.start(); RuntimeException one = new RuntimeException("One"); RuntimeException two = new RuntimeException("Two", one); RuntimeException three = new RuntimeException("Three", two); RuntimeException four = new RuntimeException("Four", three); LoggingEvent infoEvent = new LoggingEvent("fcqn", context.getLogger("fcqn"), Level.INFO, "info", four, null); String actual = converter.convert(infoEvent); assertThat(actual).isEqualTo(" [Four ! Three ! Two ! One]"); }
@Override public String convert(ILoggingEvent event) { Integer whitespace = getLeadingWhitespace(); if (whitespace < 0) { addWarn("Cannot render whitespace less than 0!"); whitespace = 0; } Integer depth = getDepth(); if (depth < 1) { addWarn("Cannot render depth less than 1!"); depth = 1; } String prefix = getPrefix(); String sep = getSeparator(); String suffix = getSuffix(); IThrowableProxy ex = event.getThrowableProxy(); if (ex == null) { return ""; } return processException(ex, whitespace, depth, prefix, sep, suffix); }
ExceptionMessageConverter extends ThrowableHandlingConverter { @Override public String convert(ILoggingEvent event) { Integer whitespace = getLeadingWhitespace(); if (whitespace < 0) { addWarn("Cannot render whitespace less than 0!"); whitespace = 0; } Integer depth = getDepth(); if (depth < 1) { addWarn("Cannot render depth less than 1!"); depth = 1; } String prefix = getPrefix(); String sep = getSeparator(); String suffix = getSuffix(); IThrowableProxy ex = event.getThrowableProxy(); if (ex == null) { return ""; } return processException(ex, whitespace, depth, prefix, sep, suffix); } }
ExceptionMessageConverter extends ThrowableHandlingConverter { @Override public String convert(ILoggingEvent event) { Integer whitespace = getLeadingWhitespace(); if (whitespace < 0) { addWarn("Cannot render whitespace less than 0!"); whitespace = 0; } Integer depth = getDepth(); if (depth < 1) { addWarn("Cannot render depth less than 1!"); depth = 1; } String prefix = getPrefix(); String sep = getSeparator(); String suffix = getSuffix(); IThrowableProxy ex = event.getThrowableProxy(); if (ex == null) { return ""; } return processException(ex, whitespace, depth, prefix, sep, suffix); }  }
ExceptionMessageConverter extends ThrowableHandlingConverter { @Override public String convert(ILoggingEvent event) { Integer whitespace = getLeadingWhitespace(); if (whitespace < 0) { addWarn("Cannot render whitespace less than 0!"); whitespace = 0; } Integer depth = getDepth(); if (depth < 1) { addWarn("Cannot render depth less than 1!"); depth = 1; } String prefix = getPrefix(); String sep = getSeparator(); String suffix = getSuffix(); IThrowableProxy ex = event.getThrowableProxy(); if (ex == null) { return ""; } return processException(ex, whitespace, depth, prefix, sep, suffix); }  @Override String convert(ILoggingEvent event); }
ExceptionMessageConverter extends ThrowableHandlingConverter { @Override public String convert(ILoggingEvent event) { Integer whitespace = getLeadingWhitespace(); if (whitespace < 0) { addWarn("Cannot render whitespace less than 0!"); whitespace = 0; } Integer depth = getDepth(); if (depth < 1) { addWarn("Cannot render depth less than 1!"); depth = 1; } String prefix = getPrefix(); String sep = getSeparator(); String suffix = getSuffix(); IThrowableProxy ex = event.getThrowableProxy(); if (ex == null) { return ""; } return processException(ex, whitespace, depth, prefix, sep, suffix); }  @Override String convert(ILoggingEvent event);  }