logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1397212 - /logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
Date Thu, 11 Oct 2012 18:09:01 GMT
Author: ggregory
Date: Thu Oct 11 18:09:01 2012
New Revision: 1397212

URL: http://svn.apache.org/viewvc?rev=1397212&view=rev
Log:
Refactor multiple occurrences of a magic string into the new private constant THROWING.

Modified:
    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/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=1397212&r1=1397211&r2=1397212&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
Thu Oct 11 18:09:01 2012
@@ -31,7 +31,9 @@ import org.apache.logging.log4j.message.
  */
 public abstract class AbstractLogger implements Logger {
 
+    private static final String THROWING = "throwing";
     private static final String CATCHING = "catching";
+    
     /**
      * Marker for flow tracing.
      */
@@ -130,7 +132,7 @@ public abstract class AbstractLogger imp
      */
     public <T extends Throwable> T throwing(T t) {
         if (isEnabled(Level.ERROR, THROWING_MARKER, (Object) null, null)) {
-            log(THROWING_MARKER, FQCN, Level.ERROR, new SimpleMessage("throwing"), t);
+            log(THROWING_MARKER, FQCN, Level.ERROR, new SimpleMessage(THROWING), t);
         }
         return t;
     }
@@ -146,7 +148,7 @@ public abstract class AbstractLogger imp
      */
     public <T extends Throwable> T throwing(Level level, T t) {
         if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
-            log(THROWING_MARKER, FQCN, level, new SimpleMessage("throwing"), t);
+            log(THROWING_MARKER, FQCN, level, new SimpleMessage(THROWING), t);
         }
         return t;
     }



Mime
View raw message