Skip to content

Commit

Permalink
[SPARK-3444] [CORE] Restore INFO level after log4j test.
Browse files Browse the repository at this point in the history
Otherwise other tests don't log anything useful...

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes apache#7140 from vanzin/SPARK-3444 and squashes the following commits:

de14836 [Marcelo Vanzin] Better fix.
6cff13a [Marcelo Vanzin] [SPARK-3444] [core] Restore INFO level after log4j test.
  • Loading branch information
Marcelo Vanzin authored and srowen committed Jul 1, 2015
1 parent 3083e17 commit 1ce6428
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,17 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {

// Test for using the util function to change our log levels.
test("log4j log level change") {
Utils.setLogLevel(org.apache.log4j.Level.ALL)
assert(log.isInfoEnabled())
Utils.setLogLevel(org.apache.log4j.Level.ERROR)
assert(!log.isInfoEnabled())
assert(log.isErrorEnabled())
val current = org.apache.log4j.Logger.getRootLogger().getLevel()
try {
Utils.setLogLevel(org.apache.log4j.Level.ALL)
assert(log.isInfoEnabled())
Utils.setLogLevel(org.apache.log4j.Level.ERROR)
assert(!log.isInfoEnabled())
assert(log.isErrorEnabled())
} finally {
// Best effort at undoing changes this test made.
Utils.setLogLevel(current)
}
}

test("deleteRecursively") {
Expand Down

0 comments on commit 1ce6428

Please sign in to comment.