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


##########
common/utils/src/test/scala/org/apache/spark/util/StructuredLoggingSuite.scala:
##########
@@ -94,19 +98,58 @@ abstract class LoggingSuiteBase extends AnyFunSuite // 
scalastyle:ignore funsuit
 }
 
 class StructuredLoggingSuite extends LoggingSuiteBase {
-  private val className = this.getClass.getName.stripSuffix("$")
+  override def className: String = classOf[StructuredLoggingSuite].getName
   override def logFilePath: String = "target/structured.log"
 
-  override def expectedPatternForBasicMsg(level: String): String =
-    s"""\\{"ts":"[^"]+","level":"$level","msg":"This is a log 
message","logger":"$className"}\n"""
+  private val jsonMapper = new 
ObjectMapper().registerModule(DefaultScalaModule)
+  private def compactAndToRegexPattern(json: String): String = {

Review Comment:
   In testing, this method `compactAndToRegexPattern` will ultimately be used 
to compact the output JSON and convert it into `a regex pattern` for matching 
and validation.



-- 
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]

Reply via email to