panbingkun commented on code in PR #46634:
URL: https://github.com/apache/spark/pull/46634#discussion_r1606310160
##########
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:
Okay, let's use `lazy val`, I have tested it and it works well.
--
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]