panbingkun commented on code in PR #45975: URL: https://github.com/apache/spark/pull/45975#discussion_r1560460023
########## common/utils/src/main/scala/org/apache/spark/internal/Logging.scala: ########## @@ -37,7 +37,10 @@ import org.apache.spark.util.SparkClassUtils * The values of the MDC will be inline in the log message, while the key-value pairs will be * part of the ThreadContext. */ -case class MDC(key: LogKey, value: Any) +case class MDC(key: LogKey, value: Any) { + require(!value.isInstanceOf[MessageWithContext], + "the class of value cannot be MessageWithContext") +} Review Comment: Although this may seem a bit weird, I think at least during the processing of structured log migration, we can maintain this logic so that we can detect similar issues during the compilation phase, https://github.com/apache/spark/pull/45926#discussion_r1558922175 -- 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