panbingkun commented on code in PR #45784: URL: https://github.com/apache/spark/pull/45784#discussion_r1545639407
########## common/utils/src/test/scala/org/apache/spark/util/StructuredLoggingSuite.scala: ########## @@ -19,23 +19,28 @@ package org.apache.spark.util import java.io.File import java.nio.file.Files +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.scala.DefaultScalaModule +import org.apache.logging.log4j.Level import org.scalatest.funsuite.AnyFunSuite // scalastyle:ignore funsuite import org.apache.spark.internal.{LogEntry, Logging, MDC} import org.apache.spark.internal.LogKey.EXECUTOR_ID -abstract class LoggingSuiteBase extends AnyFunSuite // scalastyle:ignore funsuite - with Logging { +trait LoggingSuiteBase + extends AnyFunSuite // scalastyle:ignore funsuite + with Logging { - protected def logFilePath: String + def className: String + def logFilePath: String - protected lazy val logFile: File = { + private lazy val logFile: File = { val pwd = new File(".").getCanonicalPath new File(pwd + "/" + logFilePath) } - // Returns the first line in the log file that contains the given substring. - protected def captureLogOutput(f: () => Unit): String = { + // Return the newly added log contents in the log file after executing the function `f` Review Comment: Obviously, the using of the function is: Return the newly added log contents in the log file after executing the function `f` -- 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