Back to project page slf4android.
The source code is released under:
MIT License
If you think the Android project slf4android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pl.brightinventions.slf4android; //from www .j a v a 2 s .c om import org.slf4j.helpers.FormattingTuple; import org.slf4j.helpers.MessageFormatter; import java.io.PrintWriter; import java.io.StringWriter; public class MessageValueSupplier implements LoggerPatternValueSupplier { @SuppressWarnings("ThrowableResultOfMethodCallIgnored") @Override public void append(LogRecord record, StringBuilder builder) { FormattingTuple formattingTuple = MessageFormatter.arrayFormat(record.getMessage(), record.getParameters()); String message = formattingTuple.getMessage(); Throwable throwable = formattingTuple.getThrowable(); if (throwable != null) { StringWriter writer = new StringWriter(100); PrintWriter printWriter = new PrintWriter(writer); throwable.printStackTrace(printWriter); printWriter.flush(); printWriter.close(); writer.flush(); message += " " + writer.toString(); } builder.append(message); } }