You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by xwu0226 <gi...@git.apache.org> on 2016/05/31 20:51:48 UTC

[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

GitHub user xwu0226 opened a pull request:

    https://github.com/apache/spark/pull/13422

    [SPARK-15681][core] allow lowercase or mixed case log level string when calling sc.setLogLevel

    ## What changes were proposed in this pull request?
    Currently `SparkContext API setLogLevel(level: String) `can not handle lower case or mixed case input string. But `org.apache.log4j.Level.toLevel` can take lowercase or mixed case. 
    
    Also `resetLogLevel` to original configuration could be helpful for users to switch  log level for different diagnostic purposes.
    
    
    ## How was this patch tested?
    A unit testcase is added.
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xwu0226/spark reset_loglevel

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13422.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13422
    
----
commit 1a704ef2689af2c482ba9760d90debe32ad64a70
Author: Xin Wu <xi...@us.ibm.com>
Date:   2016-05-27T16:44:47Z

    add support to reset log level to original

commit 4ecb3c9a1d1fc5ccff2c15ae84d5f5b9de553ede
Author: Xin Wu <xi...@us.ibm.com>
Date:   2016-05-28T04:19:39Z

    support reset log level

commit bb297afac8fdee4a6ca2cca6b05e7137aaab4473
Author: Xin Wu <xi...@us.ibm.com>
Date:   2016-05-31T18:58:13Z

    add testcasse for log level setting and reset

commit 01e12f3bfaf1a6bdbf382a19aaef3c776b9ef2c1
Author: Xin Wu <xi...@us.ibm.com>
Date:   2016-05-31T19:04:41Z

    reset ReplSuite

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59707 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59707/consoleFull)** for PR 13422 at commit [`b0dc5ef`](https://github.com/apache/spark/commit/b0dc5ef60d34f051f227e6220630f27725ac4785).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59714/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59714 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59714/consoleFull)** for PR 13422 at commit [`cb21175`](https://github.com/apache/spark/commit/cb21175019dc61938c01249782845d522f6cd183).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59707/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65284155
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -357,7 +357,8 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
        */
       def setLogLevel(logLevel: String) {
         val validLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
    -    if (!validLevels.contains(logLevel)) {
    +    // let's allow lowcase or mixed case too
    +    if (!validLevels.contains(logLevel.toUpperCase(Locale.ENGLISH))) {
    --- End diff --
    
    You could use `require` here even.
    My suggestion was to use a `Set` above, and, to make it a static member of an object. However, maybe that's really trivial since this method is called so infrequently.
    I do think it's best to pass the value to log4j that is validated here -- the uppercase version.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65362699
  
    --- Diff: core/src/test/scala/org/apache/spark/SparkContextSuite.scala ---
    @@ -363,4 +363,18 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext {
         sc.stop()
         assert(result == null)
       }
    +
    +  test("log level case-insensitive and reset log level") {
    +    sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
    +    val originalLevel = org.apache.log4j.Logger.getRootLogger().getLevel
    +    try {
    +      sc.setLogLevel("debug")
    +      assert(org.apache.log4j.Logger.getRootLogger().getLevel === org.apache.log4j.Level.DEBUG)
    +      sc.setLogLevel("INfo")
    +      assert(org.apache.log4j.Logger.getRootLogger().getLevel === org.apache.log4j.Level.INFO)
    +    } finally {
    +      sc.setLogLevel(originalLevel.toString)
    +      assert(org.apache.log4j.Logger.getRootLogger().getLevel === originalLevel)
    --- End diff --
    
    You need to stop the context.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by xwu0226 <gi...@git.apache.org>.
Github user xwu0226 commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    Jenkins retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59697 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59697/consoleFull)** for PR 13422 at commit [`bcb1130`](https://github.com/apache/spark/commit/bcb1130f53a467380853ff513714a30bc39d9f2e).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59681 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59681/consoleFull)** for PR 13422 at commit [`01e12f3`](https://github.com/apache/spark/commit/01e12f3bfaf1a6bdbf382a19aaef3c776b9ef2c1).
     * This patch **fails MiMa tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65362722
  
    --- Diff: repl/scala-2.11/src/test/scala/org/apache/spark/repl/ReplSuite.scala ---
    @@ -21,6 +21,7 @@ import java.io._
     import java.net.URLClassLoader
     
     import scala.collection.mutable.ArrayBuffer
    +
    --- End diff --
    
    I'd undo this change


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59678/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59739/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by xwu0226 <gi...@git.apache.org>.
Github user xwu0226 commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    @srowen Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by xwu0226 <gi...@git.apache.org>.
Github user xwu0226 commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    @srowen Thank you! I updated the code upon your comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59714 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59714/consoleFull)** for PR 13422 at commit [`cb21175`](https://github.com/apache/spark/commit/cb21175019dc61938c01249782845d522f6cd183).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59707 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59707/consoleFull)** for PR 13422 at commit [`b0dc5ef`](https://github.com/apache/spark/commit/b0dc5ef60d34f051f227e6220630f27725ac4785).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65268817
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -357,13 +359,22 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
        */
       def setLogLevel(logLevel: String) {
         val validLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
    -    if (!validLevels.contains(logLevel)) {
    +    // let's allow lowcase or mixed case too
    +    if (!validLevels.contains(logLevel.toUpperCase)) {
    --- End diff --
    
    Can `validLevels` just become a `Set` in a `SparkContext` `object`? 
    You can call `toUpperCase(Locale.ENGLISH)`, once, and save it in a val, and use the same value when checking the value and passing it to log4j, just for tidiness.
    
    I don't think the `resetLogLevel` method is worth adding.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59681 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59681/consoleFull)** for PR 13422 at commit [`01e12f3`](https://github.com/apache/spark/commit/01e12f3bfaf1a6bdbf382a19aaef3c776b9ef2c1).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59678 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59678/consoleFull)** for PR 13422 at commit [`01e12f3`](https://github.com/apache/spark/commit/01e12f3bfaf1a6bdbf382a19aaef3c776b9ef2c1).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by xwu0226 <gi...@git.apache.org>.
Github user xwu0226 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65276971
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -357,13 +359,22 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
        */
       def setLogLevel(logLevel: String) {
         val validLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
    -    if (!validLevels.contains(logLevel)) {
    +    // let's allow lowcase or mixed case too
    +    if (!validLevels.contains(logLevel.toUpperCase)) {
    --- End diff --
    
    @srowen Thanks!  The `toUpperCase` is against the user-input `logLevel`, then check it against the `validLevels` right?  `validLevels` already contain a seq of upper case values. 
    
    But i will change `toUpperCase` to `toUpperCase(Locale.ENGLISH)`
    And i will remove the `resetLogLevel`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    LGTM; merging to master / 2.0.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59697/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59678 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59678/consoleFull)** for PR 13422 at commit [`01e12f3`](https://github.com/apache/spark/commit/01e12f3bfaf1a6bdbf382a19aaef3c776b9ef2c1).
     * This patch **fails MiMa tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65362647
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -2179,6 +2178,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
      * various Spark features.
      */
     object SparkContext extends Logging {
    +  private val validLevels = Set("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
    --- End diff --
    
    Pretty minor, but I might call this `VALID_LOG_LEVELS`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by xwu0226 <gi...@git.apache.org>.
Github user xwu0226 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13422#discussion_r65284657
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -357,7 +357,8 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
        */
       def setLogLevel(logLevel: String) {
         val validLevels = Seq("ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN")
    -    if (!validLevels.contains(logLevel)) {
    +    // let's allow lowcase or mixed case too
    +    if (!validLevels.contains(logLevel.toUpperCase(Locale.ENGLISH))) {
    --- End diff --
    
    @srowen Thanks! Oh. I see what you mean. I can move the validLevels as a set as a static member. And I can also store the `logLevel.toUpperCase` to a val and pass it to log4j. The reason I was passing `logLevel` as is is because `org.apache.log4j.Level.toLevel(logLevel)` also converts it to upper case internally. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59739 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59739/consoleFull)** for PR 13422 at commit [`dab23fb`](https://github.com/apache/spark/commit/dab23fbdd61786a6847f97e8a60786161e3a62be).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13422: [SPARK-15681][core] allow lowercase or mixed case...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/13422


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59697 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59697/consoleFull)** for PR 13422 at commit [`bcb1130`](https://github.com/apache/spark/commit/bcb1130f53a467380853ff513714a30bc39d9f2e).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59681/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13422: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13422
  
    **[Test build #59739 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59739/consoleFull)** for PR 13422 at commit [`dab23fb`](https://github.com/apache/spark/commit/dab23fbdd61786a6847f97e8a60786161e3a62be).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-15681][core] allow lowercase or mixed case log le...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13422
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org