aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGuoQiang Li <witgo@qq.com>2014-08-02 13:55:28 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-08-02 13:59:58 -0700
commit4c477117bb1ffef463776c86f925d35036f96b7a (patch)
tree577c6b24c177c6a5ab36929877000907c83ffee4 /core
parent91f9504e6086fac05b40545099f9818949c24bca (diff)
downloadspark-4c477117bb1ffef463776c86f925d35036f96b7a.tar.gz
spark-4c477117bb1ffef463776c86f925d35036f96b7a.tar.bz2
spark-4c477117bb1ffef463776c86f925d35036f96b7a.zip
SPARK-2804: Remove scalalogging-slf4j dependency
This also Closes #1701. Author: GuoQiang Li <witgo@qq.com> Closes #1208 from witgo/SPARK-1470 and squashes the following commits: 422646b [GuoQiang Li] Remove scalalogging-slf4j dependency
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/Logging.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/Logging.scala b/core/src/main/scala/org/apache/spark/Logging.scala
index 807ef3e9c9..d4f2624061 100644
--- a/core/src/main/scala/org/apache/spark/Logging.scala
+++ b/core/src/main/scala/org/apache/spark/Logging.scala
@@ -39,13 +39,17 @@ trait Logging {
// be serialized and used on another machine
@transient private var log_ : Logger = null
+ // Method to get the logger name for this object
+ protected def logName = {
+ // Ignore trailing $'s in the class names for Scala objects
+ this.getClass.getName.stripSuffix("$")
+ }
+
// Method to get or create the logger for this object
protected def log: Logger = {
if (log_ == null) {
initializeIfNecessary()
- var className = this.getClass.getName
- // Ignore trailing $'s in the class names for Scala objects
- log_ = LoggerFactory.getLogger(className.stripSuffix("$"))
+ log_ = LoggerFactory.getLogger(logName)
}
log_
}