diff options
author | Dongjoon Hyun <dongjoon@apache.org> | 2016-04-21 16:09:50 -0700 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2016-04-21 16:09:50 -0700 |
commit | 411454475a031869eb7dc0c5fd84f41b3fdfa295 (patch) | |
tree | e454f88f6cbbb7ee87157ef6962573015e4bc645 /R/pkg/R/context.R | |
parent | f82aa82480d95451510ee7a74c52e83e98c8b794 (diff) | |
download | spark-411454475a031869eb7dc0c5fd84f41b3fdfa295.tar.gz spark-411454475a031869eb7dc0c5fd84f41b3fdfa295.tar.bz2 spark-411454475a031869eb7dc0c5fd84f41b3fdfa295.zip |
[SPARK-14780] [R] Add `setLogLevel` to SparkR
## What changes were proposed in this pull request?
This PR aims to add `setLogLevel` function to SparkR shell.
**Spark Shell**
```scala
scala> sc.setLogLevel("ERROR")
```
**PySpark**
```python
>>> sc.setLogLevel("ERROR")
```
**SparkR (this PR)**
```r
> setLogLevel(sc, "ERROR")
NULL
```
## How was this patch tested?
Pass the Jenkins tests including a new R testcase.
Author: Dongjoon Hyun <dongjoon@apache.org>
Closes #12547 from dongjoon-hyun/SPARK-14780.
Diffstat (limited to 'R/pkg/R/context.R')
-rw-r--r-- | R/pkg/R/context.R | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/R/pkg/R/context.R b/R/pkg/R/context.R index b0e67c8ad2..4105a6e5c8 100644 --- a/R/pkg/R/context.R +++ b/R/pkg/R/context.R @@ -225,3 +225,20 @@ broadcast <- function(sc, object) { setCheckpointDir <- function(sc, dirName) { invisible(callJMethod(sc, "setCheckpointDir", suppressWarnings(normalizePath(dirName)))) } + +#' Set new log level +#' +#' Set new log level: "ALL", "DEBUG", "ERROR", "FATAL", "INFO", "OFF", "TRACE", "WARN" +#' +#' @rdname setLogLevel +#' @param sc Spark Context to use +#' @param level New log level +#' @export +#' @examples +#'\dontrun{ +#' setLogLevel(sc, "ERROR") +#'} + +setLogLevel <- function(sc, level) { + callJMethod(sc, "setLogLevel", level) +} |