Skip to content

Commit

Permalink
Better fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Jul 1, 2015
1 parent 6cff13a commit de14836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,16 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {

// Test for using the util function to change our log levels.
test("log4j log level change") {
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. Level should be synchronized with the
// log4j.properties file used for testing.
Utils.setLogLevel(org.apache.log4j.Level.INFO)
// Best effort at undoing changes this test made.
Utils.setLogLevel(current)
}
}

Expand Down

0 comments on commit de14836

Please sign in to comment.