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 2015/08/20 04:19:11 UTC

logging-log4j2 git commit: In-line single call site private method.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master faed5fe86 -> d4d80ad5c


In-line single call site private method.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d4d80ad5
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d4d80ad5
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d4d80ad5

Branch: refs/heads/master
Commit: d4d80ad5c14f30d7f1a338e07936f8a4245730d8
Parents: faed5fe
Author: ggregory <gg...@apache.org>
Authored: Wed Aug 19 19:19:09 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Wed Aug 19 19:19:09 2015 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/config/Configurator.java     | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d4d80ad5/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
index 5b9c4d2..256fc1c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.config;
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Collection;
 import java.util.Map;
 
 import org.apache.logging.log4j.Level;
@@ -170,15 +171,7 @@ public final class Configurator {
         }
         return set;
     }
-
-    private static void setLevel(final LoggerContext loggerContext, final LoggerConfig loggerConfig,
-            final Level level) {
-        if (!loggerConfig.getLevel().equals(level)) {
-            loggerConfig.setLevel(level);
-            loggerContext.updateLoggers();
-        }
-    }
-
+    
     /**
      * Sets a logger levels.
      * 
@@ -243,7 +236,10 @@ public final class Configurator {
     public static void setRootLevel(final Level level) {
         final LoggerContext loggerContext = LoggerContext.getContext(false);
         final LoggerConfig loggerConfig = loggerContext.getConfiguration().getRootLogger();
-        setLevel(loggerContext, loggerConfig, level);
+        if (!loggerConfig.getLevel().equals(level)) {
+            loggerConfig.setLevel(level);
+            loggerContext.updateLoggers();
+        }
     }
 
     /**