logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1470226 - in /logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j: Logger.java spi/AbstractLogger.java status/StatusLogger.java
Date Sat, 20 Apr 2013 20:31:53 GMT
Author: rgoers
Date: Sat Apr 20 20:31:53 2013
New Revision: 1470226

URL: http://svn.apache.org/r1470226
Log:
LOG4J2-179 - Add isEnabled(Level, Marker)

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java?rev=1470226&r1=1470225&r2=1470226&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Logger.java Sat
Apr 20 20:31:53 2013
@@ -156,7 +156,7 @@ public interface Logger {
    * @param t       the exception to log, including its stack trace.
    */
   void debug(String message, Throwable t);
-  
+
   /**
    * Logs entry to a method.
    */
@@ -698,6 +698,15 @@ public interface Logger {
    */
   boolean isWarnEnabled(Marker marker);
 
+    /**
+     * Checks whether this logger is enabled at the specified level and an optional Marker.
+     * @param level The Level to check.
+     * @param marker The marker data specific to this log statement.
+     * @return boolean - {@code true} if this Logger is enabled for level
+     *         {@link Level#WARN WARN}, {@code false} otherwise.
+     */
+  boolean isEnabled(Level level, Marker marker);
+
   /**
    * Logs a message with the specific Marker at the given level.
    *

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=1470226&r1=1470225&r2=1470226&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
Sat Apr 20 20:31:53 2013
@@ -1162,6 +1162,10 @@ public abstract class AbstractLogger imp
         return isEnabled(Level.WARN, marker, (Object) null, null);
     }
 
+    public boolean isEnabled(final Level level, final Marker marker) {
+        return isEnabled(level, marker, (Object) null, null);
+    }
+
     /**
      * Logs a message with the specific Marker at the given level.
      *

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java?rev=1470226&r1=1470225&r2=1470226&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
Sat Apr 20 20:31:53 2013
@@ -73,7 +73,7 @@ public final class StatusLogger extends 
     public static StatusLogger getLogger() {
         return STATUS_LOGGER;
     }
-    
+
     public Level getLevel() {
         return logger.getLevel();
     }
@@ -224,7 +224,8 @@ public final class StatusLogger extends 
         return isEnabled(level, marker);
     }
 
-    protected boolean isEnabled(final Level level, final Marker marker) {
+    @Override
+    public boolean isEnabled(final Level level, final Marker marker) {
         if (listeners.size() > 0) {
             return true;
         }



Mime
View raw message