You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2022/01/09 15:42:05 UTC

[logging-log4j2] branch release-2.x updated (e1d0624 -> 5cb37cd)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


    from e1d0624  Only check if log4j-core is available once.
     new d947832  Add missing Javadoc tag.
     new 4fdfb72  Sort members.
     new 5cb37cd  Normalize Javadoc verb.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/logging/log4j/spi/LoggerContext.java    | 143 +++++++++++----------
 1 file changed, 72 insertions(+), 71 deletions(-)

[logging-log4j2] 02/03: Sort members.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 4fdfb72b57a548927dc5bc391d186c4a4859318d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 9 10:37:07 2022 -0500

    Sort members.
---
 .../apache/logging/log4j/spi/LoggerContext.java    | 130 ++++++++++-----------
 1 file changed, 65 insertions(+), 65 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
index fad0d6a..e6788b5 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
@@ -30,6 +30,46 @@ public interface LoggerContext {
     Object getExternalContext();
 
     /**
+     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
+     * @param cls The Class whose name should be used as the Logger name.
+     * @return The logger.
+     * @since 2.14.0
+     */
+    default ExtendedLogger getLogger(Class<?> cls) {
+        final String canonicalName = cls.getCanonicalName();
+        return getLogger(canonicalName != null ? canonicalName : cls.getName());
+    }
+
+    /**
+     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
+     * @param cls The Class whose name should be used as the Logger name.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the
+     *                       logger but will log a warning if mismatched.
+     * @return The logger.
+     * @since 2.14.0
+     */
+    default ExtendedLogger getLogger(Class<?> cls, MessageFactory messageFactory) {
+        final String canonicalName = cls.getCanonicalName();
+        return getLogger(canonicalName != null ? canonicalName : cls.getName(), messageFactory);
+    }
+
+    /**
+     * Returns an ExtendedLogger.
+     * @param name The name of the Logger to return.
+     * @return The logger with the specified name.
+     */
+    ExtendedLogger getLogger(String name);
+
+    /**
+     * Returns an ExtendedLogger.
+     * @param name The name of the Logger to return.
+     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
+     *                       the logger but will log a warning if mismatched.
+     * @return The logger with the specified name.
+     */
+    ExtendedLogger getLogger(String name, MessageFactory messageFactory);
+
+    /**
      * Retrieve an object by its name.
      * @param key The object's key.
      * @return The mapped Object.
@@ -40,6 +80,31 @@ public interface LoggerContext {
     }
 
     /**
+     * Detects if a Logger with the specified name exists.
+     * @param name The Logger name to search for.
+     * @return true if the Logger exists, false otherwise.
+     */
+    boolean hasLogger(String name);
+
+    /**
+     * Detects if a Logger with the specified name and MessageFactory type exists.
+     * @param name The Logger name to search for.
+     * @param messageFactoryClass The message factory class to search for.
+     * @return true if the Logger exists, false otherwise.
+     * @since 2.5
+     */
+    boolean hasLogger(String name, Class<? extends MessageFactory> messageFactoryClass);
+
+    /**
+     * Detects if a Logger with the specified name and MessageFactory exists.
+     * @param name The Logger name to search for.
+     * @param messageFactory The message factory to search for.
+     * @return true if the Logger exists, false otherwise.
+     * @since 2.5
+     */
+    boolean hasLogger(String name, MessageFactory messageFactory);
+
+    /**
      * Store an object into the LoggerContext by name for later use.
      * @param key The object's key.
      * @param value The object.
@@ -81,69 +146,4 @@ public interface LoggerContext {
     default boolean removeObject(String key, Object value) {
         return false;
     }
-
-    /**
-     * Returns an ExtendedLogger.
-     * @param name The name of the Logger to return.
-     * @return The logger with the specified name.
-     */
-    ExtendedLogger getLogger(String name);
-
-    /**
-     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
-     * @param cls The Class whose name should be used as the Logger name.
-     * @return The logger.
-     * @since 2.14.0
-     */
-    default ExtendedLogger getLogger(Class<?> cls) {
-        final String canonicalName = cls.getCanonicalName();
-        return getLogger(canonicalName != null ? canonicalName : cls.getName());
-    }
-
-    /**
-     * Returns an ExtendedLogger.
-     * @param name The name of the Logger to return.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
-     *                       the logger but will log a warning if mismatched.
-     * @return The logger with the specified name.
-     */
-    ExtendedLogger getLogger(String name, MessageFactory messageFactory);
-
-    /**
-     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
-     * @param cls The Class whose name should be used as the Logger name.
-     * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the
-     *                       logger but will log a warning if mismatched.
-     * @return The logger.
-     * @since 2.14.0
-     */
-    default ExtendedLogger getLogger(Class<?> cls, MessageFactory messageFactory) {
-        final String canonicalName = cls.getCanonicalName();
-        return getLogger(canonicalName != null ? canonicalName : cls.getName(), messageFactory);
-    }
-
-    /**
-     * Detects if a Logger with the specified name exists.
-     * @param name The Logger name to search for.
-     * @return true if the Logger exists, false otherwise.
-     */
-    boolean hasLogger(String name);
-
-    /**
-     * Detects if a Logger with the specified name and MessageFactory exists.
-     * @param name The Logger name to search for.
-     * @param messageFactory The message factory to search for.
-     * @return true if the Logger exists, false otherwise.
-     * @since 2.5
-     */
-    boolean hasLogger(String name, MessageFactory messageFactory);
-
-    /**
-     * Detects if a Logger with the specified name and MessageFactory type exists.
-     * @param name The Logger name to search for.
-     * @param messageFactoryClass The message factory class to search for.
-     * @return true if the Logger exists, false otherwise.
-     * @since 2.5
-     */
-    boolean hasLogger(String name, Class<? extends MessageFactory> messageFactoryClass);
 }

[logging-log4j2] 01/03: Add missing Javadoc tag.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit d9478328568e9bbad8134275b5457a450800450f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 9 10:36:48 2022 -0500

    Add missing Javadoc tag.
---
 log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
index eab7b51..fad0d6a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
@@ -32,6 +32,7 @@ public interface LoggerContext {
     /**
      * Retrieve an object by its name.
      * @param key The object's key.
+     * @return The mapped Object.
      * @since 2.13.0
      */
     default Object getObject(String key) {

[logging-log4j2] 03/03: Normalize Javadoc verb.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 5cb37cd441311906f121a4d58a9da1e5cd7648c2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 9 10:38:34 2022 -0500

    Normalize Javadoc verb.
---
 .../apache/logging/log4j/spi/LoggerContext.java    | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
index e6788b5..78d1585 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
@@ -24,13 +24,13 @@ import org.apache.logging.log4j.message.MessageFactory;
 public interface LoggerContext {
 
     /**
-     * An anchor for some other context, such as a ClassLoader or ServletContext.
+     * Gets the anchor for some other context, such as a ClassLoader or ServletContext.
      * @return The external context.
      */
     Object getExternalContext();
 
     /**
-     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
+     * Gets an ExtendedLogger using the fully qualified name of the Class as the Logger name.
      * @param cls The Class whose name should be used as the Logger name.
      * @return The logger.
      * @since 2.14.0
@@ -41,7 +41,7 @@ public interface LoggerContext {
     }
 
     /**
-     * Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
+     * Gets an ExtendedLogger using the fully qualified name of the Class as the Logger name.
      * @param cls The Class whose name should be used as the Logger name.
      * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the
      *                       logger but will log a warning if mismatched.
@@ -54,14 +54,14 @@ public interface LoggerContext {
     }
 
     /**
-     * Returns an ExtendedLogger.
+     * Gets an ExtendedLogger.
      * @param name The name of the Logger to return.
      * @return The logger with the specified name.
      */
     ExtendedLogger getLogger(String name);
 
     /**
-     * Returns an ExtendedLogger.
+     * Gets an ExtendedLogger.
      * @param name The name of the Logger to return.
      * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change
      *                       the logger but will log a warning if mismatched.
@@ -70,7 +70,7 @@ public interface LoggerContext {
     ExtendedLogger getLogger(String name, MessageFactory messageFactory);
 
     /**
-     * Retrieve an object by its name.
+     * Gets an object by its name.
      * @param key The object's key.
      * @return The mapped Object.
      * @since 2.13.0
@@ -80,14 +80,14 @@ public interface LoggerContext {
     }
 
     /**
-     * Detects if a Logger with the specified name exists.
+     * Tests if a Logger with the specified name exists.
      * @param name The Logger name to search for.
      * @return true if the Logger exists, false otherwise.
      */
     boolean hasLogger(String name);
 
     /**
-     * Detects if a Logger with the specified name and MessageFactory type exists.
+     * Tests if a Logger with the specified name and MessageFactory type exists.
      * @param name The Logger name to search for.
      * @param messageFactoryClass The message factory class to search for.
      * @return true if the Logger exists, false otherwise.
@@ -96,7 +96,7 @@ public interface LoggerContext {
     boolean hasLogger(String name, Class<? extends MessageFactory> messageFactoryClass);
 
     /**
-     * Detects if a Logger with the specified name and MessageFactory exists.
+     * Tests if a Logger with the specified name and MessageFactory exists.
      * @param name The Logger name to search for.
      * @param messageFactory The message factory to search for.
      * @return true if the Logger exists, false otherwise.
@@ -105,7 +105,7 @@ public interface LoggerContext {
     boolean hasLogger(String name, MessageFactory messageFactory);
 
     /**
-     * Store an object into the LoggerContext by name for later use.
+     * Associates an object into the LoggerContext by name for later use.
      * @param key The object's key.
      * @param value The object.
      * @return The previous object or null.
@@ -116,7 +116,7 @@ public interface LoggerContext {
     }
 
     /**
-     * Store an object into the LoggerContext by name for later use if an object is not already stored with that key.
+     * Associates an object into the LoggerContext by name for later use if an object is not already stored with that key.
      * @param key The object's key.
      * @param value The object.
      * @return The previous object or null.
@@ -127,7 +127,7 @@ public interface LoggerContext {
     }
 
     /**
-     * Remove an object if it is present.
+     * Removes an object if it is present.
      * @param key The object's key.
      * @return The object if it was present, null if it was not.
      * @since 2.13.0
@@ -137,7 +137,7 @@ public interface LoggerContext {
     }
 
     /**
-     * Remove an object if it is present and the provided object is stored.
+     * Removes an object if it is present and the provided object is stored.
      * @param key The object's key.
      * @param value The object.
      * @return The object if it was present, null if it was not.