panbingkun commented on code in PR #46634:
URL: https://github.com/apache/spark/pull/46634#discussion_r1604501263


##########
common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala:
##########
@@ -22,7 +22,7 @@ import java.util.Locale
  * All structured logging `keys` used in `MDC` must be extends `LogKey`
  */
 trait LogKey {
-  val name: String = this.toString.toLowerCase(Locale.ROOT)
+  def name: String = 
this.getClass.getSimpleName.stripSuffix("$").toLowerCase(Locale.ROOT)

Review Comment:
   If we don't make such changes, the `JavaCustomLogKeys`(Custom `LogKey` that 
may be extended by `external third-party ecosystems`) class will have to be 
defined like this, which is very ugly and looks weird.
   <img width="772" alt="image" 
src="https://github.com/apache/spark/assets/15246973/9e621224-254c-4b62-8aaa-2973dd4e7b3a";>
   



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to