diff --git a/src/java/org/apache/poi/util/NullLogger.java b/src/java/org/apache/poi/util/NullLogger.java index d4fc574426..8a50cffba4 100644 --- a/src/java/org/apache/poi/util/NullLogger.java +++ b/src/java/org/apache/poi/util/NullLogger.java @@ -23,6 +23,7 @@ package org.apache.poi.util; * calls as cheap as possible by performing lazy evaluation of the log * message.

*/ +@Internal public class NullLogger extends POILogger { @Override public void initialize(final String cat) { @@ -37,7 +38,7 @@ public class NullLogger extends POILogger { */ @Override - public void log(final int level, final Object obj1) { + protected void log(final int level, final Object obj1) { // do nothing } @@ -49,7 +50,7 @@ public class NullLogger extends POILogger { * @param exception An exception to be logged */ @Override - public void log(int level, Object obj1, final Throwable exception) { + protected void log(int level, Object obj1, final Throwable exception) { // do nothing } diff --git a/src/java/org/apache/poi/util/POILogger.java b/src/java/org/apache/poi/util/POILogger.java index 04198bfbab..9238de01cc 100644 --- a/src/java/org/apache/poi/util/POILogger.java +++ b/src/java/org/apache/poi/util/POILogger.java @@ -68,6 +68,15 @@ public abstract class POILogger { /** * Check if a logger is enabled to log at the specified level + * This allows code to avoid building strings or evaluating functions in + * the arguments to log. + * + * An example: + *

+     * if (logger.check(POILogger.INFO)) {
+     *     logger.log(POILogger.INFO, "Avoid concatenating " + " strings and evaluating " + functions());
+     * }
+     * 
* * @param level One of DEBUG, INFO, WARN, ERROR, FATAL */