You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "gengliangwang (via GitHub)" <gi...@apache.org> on 2024/04/11 04:45:58 UTC

Re: [PR] [SPARK-47792][CORE] Make the value of MDC can support `null` & cannot be `MessageWithContext` [spark]

gengliangwang commented on code in PR #45975:
URL: https://github.com/apache/spark/pull/45975#discussion_r1560429054


##########
common/utils/src/main/scala/org/apache/spark/internal/Logging.scala:
##########
@@ -105,9 +108,10 @@ trait Logging {
       val context = new java.util.HashMap[String, String]()
 
       args.foreach { mdc =>
-        sb.append(mdc.value.toString)
+        val value = if (mdc.value != null) mdc.value.toString else null

Review Comment:
   @panbingkun nice catch. What will the null become in the log output?



-- 
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-unsubscribe@spark.apache.org

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


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