hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1147966 - in /hadoop/common/trunk/common: CHANGES.txt src/java/org/apache/hadoop/log/LogLevel.java
Date Mon, 18 Jul 2011 16:49:01 GMT
Author: eli
Date: Mon Jul 18 16:49:00 2011
New Revision: 1147966

URL: http://svn.apache.org/viewvc?rev=1147966&view=rev
Log:
HADOOP-7434. Display error when using "daemonlog -setlevel" with illegal level. Contributed
by yanjinshuang

Modified:
    hadoop/common/trunk/common/CHANGES.txt
    hadoop/common/trunk/common/src/java/org/apache/hadoop/log/LogLevel.java

Modified: hadoop/common/trunk/common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/CHANGES.txt?rev=1147966&r1=1147965&r2=1147966&view=diff
==============================================================================
--- hadoop/common/trunk/common/CHANGES.txt (original)
+++ hadoop/common/trunk/common/CHANGES.txt Mon Jul 18 16:49:00 2011
@@ -272,6 +272,9 @@ Trunk (unreleased changes)
     HADOOP-7465. A several tiny improvements for the LOG format.
     (Xie Xianshan via eli)
 
+    HADOOP-7434. Display error when using "daemonlog -setlevel" with
+    illegal level. (yanjinshuang via eli)
+
   OPTIMIZATIONS
   
     HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/log/LogLevel.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/log/LogLevel.java?rev=1147966&r1=1147965&r2=1147966&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/log/LogLevel.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/log/LogLevel.java Mon Jul 18 16:49:00
2011
@@ -142,8 +142,12 @@ public class LogLevel {
     private static void process(org.apache.log4j.Logger log, String level,
         PrintWriter out) throws IOException {
       if (level != null) {
-        log.setLevel(org.apache.log4j.Level.toLevel(level));
-        out.println(MARKER + "Setting Level to " + level + " ...<br />");
+        if (!level.equals(org.apache.log4j.Level.toLevel(level).toString())) {
+          out.println(MARKER + "Bad level : <b>" + level + "</b><br />");
+        } else {
+          log.setLevel(org.apache.log4j.Level.toLevel(level));
+          out.println(MARKER + "Setting Level to " + level + " ...<br />");
+        }
       }
       out.println(MARKER
           + "Effective level: <b>" + log.getEffectiveLevel() + "</b><br />");



Mime
View raw message