Repository: logging-log4j2 Updated Branches: refs/heads/master 6f39fce8c -> 307257b3d
[LOG4J2-2053] Exception java.nio.charset.UnsupportedCharsetException: cp65001 in 2.9.0. Add another service to low-level error reporting. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/307257b3 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/307257b3 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/307257b3 Branch: refs/heads/master Commit: 307257b3d78f8502c3526cbd0b8d41b88c294482 Parents: 6f39fce Author: Gary Gregory <[email protected]> Authored: Fri Oct 6 16:41:24 2017 -0600 Committer: Gary Gregory <[email protected]> Committed: Fri Oct 6 16:41:24 2017 -0600 ---------------------------------------------------------------------- .../apache/logging/log4j/util/LowLevelLogUtil.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/307257b3/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java index a447bcc..5cf40ca 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java @@ -33,6 +33,18 @@ final class LowLevelLogUtil { private static PrintWriter writer = new PrintWriter(System.err, true); + /** + * Logs the given message. + * + * @param message the message to log + * @since 2.9.2 + */ + public static void log(final String message) { + if (message != null) { + writer.println(message); + } + } + public static void logException(final Throwable exception) { if (exception != null) { exception.printStackTrace(writer); @@ -40,9 +52,7 @@ final class LowLevelLogUtil { } public static void logException(final String message, final Throwable exception) { - if (message != null) { - writer.println(message); - } + log(message); logException(exception); }
