HADOOP-7434. Display error when using "daemonlog -setlevel" with illegal level. Contributed by yanjinshuang
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1147966 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a77d0b289
commit
0a84abfed0
|
@ -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
|
||||
|
|
|
@ -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 />");
|
||||
|
|
Loading…
Reference in New Issue