viirya commented on a change in pull request #34895:
URL: https://github.com/apache/spark/pull/34895#discussion_r772733237
##########
File path: core/src/main/scala/org/apache/spark/internal/Logging.scala
##########
@@ -222,31 +231,119 @@ private[spark] object Logging {
val binderClass = StaticLoggerBinder.getSingleton.getLoggerFactoryClassStr
"org.slf4j.impl.Log4jLoggerFactory".equals(binderClass)
}
-}
-private class SparkShellLoggingFilter extends Filter {
- /**
- * If sparkShellThresholdLevel is not defined, this filter is a no-op.
- * If log level of event is not equal to root level, the event is allowed.
Otherwise,
- * the decision is made based on whether the log came from root or some
custom configuration
- * @param loggingEvent
- * @return decision for accept/deny log event
- */
- def decide(loggingEvent: LoggingEvent): Int = {
- if (Logging.sparkShellThresholdLevel == null) {
- Filter.NEUTRAL
- } else if
(loggingEvent.getLevel.isGreaterOrEqual(Logging.sparkShellThresholdLevel)) {
- Filter.NEUTRAL
- } else {
- var logger = loggingEvent.getLogger()
- while (logger.getParent() != null) {
- if (logger.getLevel != null || logger.getAllAppenders.hasMoreElements)
{
- return Filter.NEUTRAL
+ private class SparkShellLoggingFilter extends Filter {
Review comment:
Okay. I will try to rewrite this with `AbstractFilter`. I think the
functionality should be the same but yea it looks better to use
`AbstractFilter` here.
--
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]