logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1470228 - in /logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j: Level.java LogManager.java message/MapMessage.java simple/SimpleLogger.java spi/AbstractLogger.java
Date Sat, 20 Apr 2013 21:05:40 GMT
Author: rgoers
Date: Sat Apr 20 21:05:39 2013
New Revision: 1470228

URL: http://svn.apache.org/r1470228
Log:
Fix checkstyle errors in API

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Level.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/LogManager.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Level.java?rev=1470228&r1=1470227&r2=1470228&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Level.java (original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/Level.java Sat Apr
20 21:05:39 2013
@@ -36,42 +36,42 @@ import java.util.Locale;
  * A special level, {@link #ALL}, is guaranteed to capture all levels when used in logging
configurations.
  */
 public enum Level {
-    
+
     /**
      * No events will be logged.
      */
     OFF(0),
-    
+
     /**
      * A severe error that will prevent the application from continuing.
      */
     FATAL(1),
-    
+
     /**
      * An error in the application, possibly recoverable.
      */
     ERROR(2),
-    
+
     /**
      * An event that might possible lead to an error.
      */
     WARN(3),
-    
+
     /**
      * An event for informational purposes.
      */
     INFO(4),
-    
+
     /**
      * A general debugging event.
      */
     DEBUG(5),
-    
+
     /**
      * A fine-grained debug message, typically capturing the flow through the application.
      */
     TRACE(6),
-    
+
     /**
      * All events should be logged.
      */

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=1470228&r1=1470227&r2=1470228&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
Sat Apr 20 21:05:39 2013
@@ -175,6 +175,7 @@ public class LogManager {
      * example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext
may be
      * returned and if the caller is a class in the container's classpath then a different
LoggerContext may be
      * returned. If true then only a single LoggerContext will be returned.
+     * @param configLocation The URI for the configuration to use.
      * @return a LoggerContext.
      */
     public static LoggerContext getContext(final ClassLoader loader, final boolean currentContext,

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java?rev=1470228&r1=1470227&r2=1470228&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
Sat Apr 20 21:05:39 2013
@@ -193,7 +193,8 @@ public class MapMessage implements Multi
     public void asXML(final StringBuilder sb) {
         sb.append("<Map>\n");
         for (final Map.Entry<String, String> entry : data.entrySet()) {
-            sb.append("  <Entry key=\"").append(entry.getKey()).append("\">").append(entry.getValue()).append("</Entry>\n");
+            sb.append("  <Entry key=\"").append(entry.getKey()).append("\">").append(entry.getValue())
+              .append("</Entry>\n");
         }
         sb.append("</Map>");
     }

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java?rev=1470228&r1=1470227&r2=1470228&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
Sat Apr 20 21:05:39 2013
@@ -89,7 +89,7 @@ public class SimpleLogger extends Abstra
     public void setStream(final PrintStream stream) {
         this.stream = stream;
     }
-    
+
     public Level getLevel() {
         return 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=1470228&r1=1470227&r2=1470228&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 21:05:39 2013
@@ -74,35 +74,6 @@ public abstract class AbstractLogger imp
 
     private static final String CATCHING = "catching";
 
-    /**
-     * Checks that the message factory a logger was created with is the same as the given
messageFactory. If they are
-     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates
to the default
-     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
-     *
-     * @param logger
-     *            The logger to check
-     * @param messageFactory
-     *            The message factory to check.
-     */
-    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory)
{
-        final String name = logger.getName();
-        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
-        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory))
{
-            StatusLogger
-                    .getLogger()
-                    .warn("The Logger {} was created with the message factory {} and is now
requested with the " +
-                        "message factory {}, which may create log events with unexpected
formatting.",
-                            name, loggerMessageFactory, messageFactory);
-        } else if (messageFactory == null
-                && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS))
{
-            StatusLogger
-                    .getLogger()
-                    .warn("The Logger {} was created with the message factory {} and is now
requested with a null " +
-                        "message factory (defaults to {}), which may create log events with
unexpected formatting.",
-                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
-        }
-    }
-
     private final String name;
 
     private final MessageFactory messageFactory;
@@ -137,6 +108,35 @@ public abstract class AbstractLogger imp
     }
 
     /**
+     * Checks that the message factory a logger was created with is the same as the given
messageFactory. If they are
+     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates
to the default
+     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
+     *
+     * @param logger
+     *            The logger to check
+     * @param messageFactory
+     *            The message factory to check.
+     */
+    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory)
{
+        final String name = logger.getName();
+        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
+        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory))
{
+            StatusLogger
+                .getLogger()
+                .warn("The Logger {} was created with the message factory {} and is now requested
with the " +
+                    "message factory {}, which may create log events with unexpected formatting.",
+                    name, loggerMessageFactory, messageFactory);
+        } else if (messageFactory == null
+            && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS))
{
+            StatusLogger
+                .getLogger()
+                .warn("The Logger {} was created with the message factory {} and is now requested
with a null " +
+                    "message factory (defaults to {}), which may create log events with unexpected
formatting.",
+                    name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
+        }
+    }
+
+    /**
      * Logs a Throwable that has been caught.
      *
      * @param level The logging Level.



Mime
View raw message