xkrogen commented on a change in pull request #33446:
URL: https://github.com/apache/spark/pull/33446#discussion_r675669285



##########
File path: core/src/main/scala/org/apache/spark/TestUtils.scala
##########
@@ -448,6 +451,34 @@ private[spark] object TestUtils {
       EnumSet.of(OWNER_READ, OWNER_EXECUTE, OWNER_WRITE))
     file.getPath
   }
+
+  /**
+   * A log4j-specific log capturing mechanism. Provided with a class name, it 
will add a new
+   * appender to the log for that class to capture the output. log4j must be 
properly configured
+   * on the classpath (e.g., with slf4j-log4j12) for this to work. This should 
be closed when it is
+   * done to remove the temporary appender.
+   */
+  class Log4jCapture(val loggerName: String) extends AutoCloseable {

Review comment:
       Nice ... when initially writing up the `Log4jCapture` class, I looked 
all through Spark utilities to find an existing utility and was surprised to 
find nothing, guess I just had to look in Scalatest!




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