Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2EBE8E6BE for ; Tue, 25 Jun 2013 18:08:58 +0000 (UTC) Received: (qmail 9070 invoked by uid 500); 25 Jun 2013 18:08:58 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 9051 invoked by uid 500); 25 Jun 2013 18:08:57 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 9044 invoked by uid 99); 25 Jun 2013 18:08:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 18:08:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 18:08:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2E96623888FE; Tue, 25 Jun 2013 18:08:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1496567 - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/LogManager.java src/changes/changes.xml Date: Tue, 25 Jun 2013 18:08:36 -0000 To: commits@logging.apache.org From: rgoers@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130625180836.2E96623888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rgoers Date: Tue Jun 25 18:08:35 2013 New Revision: 1496567 URL: http://svn.apache.org/r1496567 Log: Add javadoc and update changes.xml Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java logging/log4j/log4j2/trunk/src/changes/changes.xml Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java?rev=1496567&r1=1496566&r2=1496567&view=diff ============================================================================== --- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java (original) +++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java Tue Jun 25 18:08:35 2013 @@ -295,8 +295,7 @@ public class LogManager { * Short-hand for {@code getLogger(name, StringFormatterMessageFactory.INSTANCE)} *

* - * @param name - * The logger name. + * @param name The logger name. If null it will default to the name of the calling class. * @return The Logger, created with a {@link StringFormatterMessageFactory} * @see Logger#fatal(Marker, String, Object...) * @see Logger#fatal(String, Object...) @@ -321,7 +320,8 @@ public class LogManager { /** * Returns a Logger using the fully qualified name of the Class as the Logger name. - * @param clazz The Class whose name should be used as the Logger name. + * @param clazz The Class whose name should be used as the Logger name. If null it will default to the calling + * class. * @return The Logger. */ public static Logger getLogger(final Class clazz) { @@ -330,7 +330,8 @@ public class LogManager { /** * Returns a Logger using the fully qualified name of the Class as the Logger name. - * @param clazz The Class whose name should be used as the Logger name. + * @param clazz The Class whose name should be used as the Logger name. If null it will default to the calling + * class. * @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. @@ -341,7 +342,8 @@ public class LogManager { /** * Returns a Logger using the fully qualified class name of the value as the Logger name. - * @param value The value whose class name should be used as the Logger name. + * @param value The value whose class name should be used as the Logger name. If null the name of the calling + * class will be used as the logger name. * @return The Logger. */ public static Logger getLogger(final Object value) { @@ -353,7 +355,8 @@ public class LogManager { /** * Returns a Logger using the fully qualified class name of the value as the Logger name. - * @param value The value whose class name should be used as the Logger name. + * @param value The value whose class name should be used as the Logger name. If null the name of the calling + * class will 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. @@ -368,7 +371,7 @@ public class LogManager { /** * Returns a Logger with the specified name. * - * @param name The logger name. + * @param name The logger name. If null the name of the calling class will be used. * @return The Logger. */ public static Logger getLogger(final String name) { @@ -381,7 +384,7 @@ public class LogManager { /** * Returns a Logger with the specified name. * - * @param name The logger name. + * @param name The logger name. If null the name of the calling class will be used. * @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. @@ -393,11 +396,20 @@ public class LogManager { return getLogger(getClassName(2), messageFactory); } + /** + * Returns a Logger with the name of the calling class. + * @return The Logger for the calling class. + */ public static Logger getLogger() { return getLogger(getClassName(2)); } - + /** + * Returns a Logger with the name of the calling class. + * @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 for the calling class. + */ public static Logger getLogger(final MessageFactory messageFactory) { return getLogger(getClassName(2), messageFactory); } Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1496567&r1=1496566&r2=1496567&view=diff ============================================================================== --- logging/log4j/log4j2/trunk/src/changes/changes.xml (original) +++ logging/log4j/log4j2/trunk/src/changes/changes.xml Tue Jun 25 18:08:35 2013 @@ -21,6 +21,9 @@ + + LogManager.getLogger can now be called without a logger name or with a null logger name. + Add javadoc fix tool to site build.