haiyangsun-db commented on code in PR #55768:
URL: https://github.com/apache/spark/pull/55768#discussion_r3215781576
##########
udf/worker/core/src/main/scala/org/apache/spark/udf/worker/core/WorkerLogger.scala:
##########
@@ -36,15 +36,43 @@ import org.apache.spark.annotation.Experimental
trait WorkerLogger {
def warn(msg: => String): Unit
def warn(msg: => String, t: Throwable): Unit
+ def info(msg: => String): Unit
+ def info(msg: => String, t: Throwable): Unit
def debug(msg: => String): Unit
def debug(msg: => String, t: Throwable): Unit
+
+ /**
+ * Returns a new [[WorkerLogger]] that prefixes every message with
+ * `[className]`. Useful for identifying which class produced a
+ * log line.
+ */
+ def forClass(clazz: Class[_]): WorkerLogger = {
Review Comment:
this looks a little bit weird to me - why we don't make this a static
function from a singleton class, and make the prefix a required field in the
WorkerLogger?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]