logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1581076 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
Date Mon, 24 Mar 2014 21:36:33 GMT
Author: ggregory
Date: Mon Mar 24 21:36:33 2014
New Revision: 1581076

URL: http://svn.apache.org/r1581076
Log:
Detects if a Logger with the specified name exists. This is a convenience method for porting
from version 1.

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java?rev=1581076&r1=1581075&r2=1581076&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
Mon Mar 24 21:36:33 2014
@@ -122,6 +122,18 @@ public class LogManager {
     }
 
     /**
+     * Detects if a Logger with the specified name exists. This is a convenience method for
porting from version 1.
+     * 
+     * @param name
+     *            The Logger name to search for.
+     * @return true if the Logger exists, false otherwise.
+     * @see LoggerContext#hasLogger(String)
+     */
+    public static boolean exists(String name) {
+        return getContext().hasLogger(name);
+    }
+
+    /**
      * Gets the class name of the caller in the current stack at the given {@code depth}.
      *
      * @param depth a 0-based index in the current stack.



Mime
View raw message