Add newlines to separate log events/messages appended to the String.

Resolves gh-73.
This commit is contained in:
John Blum
2020-02-13 00:11:50 -08:00
parent e4613a1fcc
commit 348d981b3a

View File

@@ -40,6 +40,7 @@ import ch.qos.logback.core.Context;
public class StringAppender extends AppenderBase<ILoggingEvent> {
protected static final String DEFAULT_NAME = "string";
protected static final String NEWLINE = "\n";
@FunctionalInterface
interface StringAppenderWrapper {
@@ -53,6 +54,7 @@ public class StringAppender extends AppenderBase<ILoggingEvent> {
@Override
public void append(CharSequence charSequence) {
this.stringBuilder.append(charSequence);
this.stringBuilder.append(NEWLINE);
}
@Override
@@ -68,6 +70,7 @@ public class StringAppender extends AppenderBase<ILoggingEvent> {
@Override
public void append(CharSequence charSequence) {
this.stringBuffer.append(charSequence);
this.stringBuffer.append(NEWLINE);
}
@Override