Skip to content

Commit

Permalink
fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed May 1, 2015
1 parent 9117244 commit 42ba873
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
* Valid log levels include: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
*/
def setLogLevel(logLevel: String) {
val logLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
if (!logLevels.contains(logLevel)) {
throw new InvalidArgumentException(
val validLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
if (!validLevels.contains(logLevel)) {
throw new IllegalArgumentException(
s"Supplied level $logLevel did not match one of: ${validLevels.mkString(',')}")
}
Utils.setLogLevel(org.apache.log4j.Level.toLevel(logLevel))
Expand Down

0 comments on commit 42ba873

Please sign in to comment.