Process line.

        Overwrite BaseFilter.accept() and return True if the provided
        logevent should be accepted (causing output), or False if not.
170646
def accept(self, logevent):
        
        dt = logevent.datetime
        if not dt:
            return False

        mask = next((mask for mask in self.mask_list
                     if mask[0] < dt and mask[1] > dt), None)

        return True if mask else False
229252
@Override
    public boolean accept(RepositoryLogRecord record) {
        /*
         * Logic operates under assumption that record will be accepted by default, therefore
         * filtering check if record should be excluded
         */

        // Filtering by threadID
        if (filterThread) {
            if (intThreadID != record.getThreadID()) {
                return false; // no need to continue, this record does not pass
            }
        }

        // Filtering by level
        if (filterLevel) {
            if (minLevel != null) {
                if (record.getLevel().intValue() < minLevel.intValue()) {
                    return false; // no need to continue, this record does not pass
                }
            }
            if (maxLevel != null) {
                if (record.getLevel().intValue() > maxLevel.intValue()) {
                    return false; // no need to continue, this record does not pass
                }
            }
        }

        // Filtering by Date/Time
        if (filterTime) {
            Date recordDate = new Date();
            recordDate.setTime(record.getMillis());
            if (startDate != null) {
                if (recordDate.before(startDate)) {
                    return false; // no need to continue, this record does not
                    // pass
                }
            }
            if (stopDate != null) {
                if (recordDate.after(stopDate)) {
                    return false; // no need to continue, this record does not
                    // pass
                }
            }
        }

        // Filtering by Logger
        if (filterLoggers) {
            /*
             * Can't return false at first filter out in case of loggers cause it's possible
             * that a more specific include could over-ride the exclude. So we check them all -
             * and track the highest include and exclude matches. If there are no matches for
             * either include or exclude default is to exclude it.
             */
            int excludeMatchLevel = -1;
            int includeMatchLevel = -1;

            if (excludeLoggers != null) {
                for (String x : exLoggers) {
                    if (record.getLoggerName() != null && record.getLoggerName().matches(x.replace("*", ".*"))) {
                        int tmpInt = x.split("\\.").length;
                        if (tmpInt > excludeMatchLevel)
                            // This match is higher than any previous matches
                            excludeMatchLevel = tmpInt;
                    }
                }
            } else
                excludeMatchLevel = 0; // Equivalent of excludeLoggers="*"

            if (includeLoggers != null) {
                for (String x : inLoggers) {
                    if (record.getLoggerName() != null && record.getLoggerName().matches(x.replace("*", ".*"))) {
                        int tmpInt = x.split("\\.").length;
                        if (tmpInt > includeMatchLevel)
                            // This match is higher than any previous matches
                            includeMatchLevel = tmpInt;
                    }
                }
            } else
                includeMatchLevel = 0; // Equivalent of includeLoggers="*"

            // Only want to accept the record if it matches an include, and does
            // not match an exclude (of greater value if it matches both).
            if (includeLoggers == null) {
                // default include is *
            }

            // Using equals on match level, so default will be to exclude a record if user has
            // defined both include and exclude Logger criteria and we did not match on either
            // case
            if (includeMatchLevel <= excludeMatchLevel)
                return false;
        }

        // Filtering by message
        if (filterMessage) {
            String recordMessage = (record.getFormattedMessage() != null) ? record.getFormattedMessage() : record.getRawMessage();

            if (recordMessage == null) {
                return false;
            }

            recordMessage = recordMessage.replace("\n", "").replace("\r", "");

            if (messageRegExp != null) {
                boolean foundmessagekey = messageRegExp.matcher(recordMessage).find();
                if (!foundmessagekey) {
                    return false;
                }
            }

            if (excludeMessages != null) {
                for (Pattern p : excludeMessagesRegExpPatterns) {
                    boolean excludeMsg = p.matcher(recordMessage).find();
                    if (excludeMsg) {
                        // The Log record message will be excluded from the Log viewer.
                        return false;
                    }
                }
            }

        }

        // Filtering by extension
        if (extensions != null) {
            boolean match = false;
            for (Extension extension : extensions) {
                String value = record.getExtension(extension.key);
                if (value != null) {

                    if (extension.value == null || includeExtensionRegExpPatterns.get(includeExtensionRegExpKeys.indexOf(extension.key)).matcher(value).find()) {
                        match = true;
                        break;
                    }
                }
            }
            if (!match) {
                return false;
            }
        }

        // if we made it this far, then the record should be good.
        return true;
    }
489992
private boolean accept(FileData target, FileData source) {
        return (target.getLastModifiedTime() < source.getLastModifiedTime()) || (target.getSize() != source.getSize());
    }
1190695
public function accept(LogEvent $event) : bool
    {
        if (empty($event['origin']['class'])) {
            return false;
        }

        switch ($this->searchMethod) {
            case static::SEARCH_METHOD_STARTS_WITH:
                return (strpos($event['origin']['class'], $this->expectedNamespace) === 0);
            case static::SEARCH_METHOD_CONTAINS:
                $pos = strpos($event['origin']['class'], $this->expectedNamespace);
                if ($pos === false) {
                    return false;
                }

                return ($pos >= 0);
            case static::SEARCH_METHOD_REGEXP:
                return (preg_match($this->expectedNamespace, $event['origin']['class']) > 0);
        }
    // @codeCoverageIgnoreStart
    }
933054
public
  int decide(LoggingEvent event) {
    String msg = event.getRenderedMessage();

    if(msg == null ||  stringToMatch == null)
      return Filter.NEUTRAL;
    

    if( msg.indexOf(stringToMatch) == -1 ) {
      return Filter.NEUTRAL;
    } else { // we've got a match
      if(acceptOnMatch) {
	return Filter.ACCEPT;
      } else {
	return Filter.DENY;
      }
    }
  }
837295
private void processFilterAction() {
		if (!(chkFilter.isSelected())) {
			applyFilters(new ArrayList<>());
		}
		if (chkFilter.isSelected()) {
			if (txtFilter.getText().isEmpty()) {
				chkFilter.setSelected(false);
				applyFilters(new ArrayList<>());
				return;
			}
			try {
				List<TreeModelFilter<SQLPPTriplesMap>> filters = parseSearchString(txtFilter.getText());
				if (filters == null) {
					throw new Exception("Impossible to parse search string");
				}
				applyFilters(filters);
			} catch (Exception e) {
				LoggerFactory.getLogger(this.getClass()).debug(e.getMessage(), e);
				JOptionPane.showMessageDialog(this, e.getMessage());
			}
		}
	}
771115
def accept_line(self, logevent):
        
        if ("is now in state" in logevent.line_str and
                logevent.split_tokens[-1] in self.states):
            return True

        if ("replSet" in logevent.line_str and
                logevent.thread == "rsMgr" and
                logevent.split_tokens[-1] in self.states):
            return True

        return False
667075
public void accept(XVisitor visitor, XLog log) {
		/*
		 * First call.
		 */
		visitor.visitTracePre(this, log);
		/*
		 * Visit the attributes.
		 */
		for (XAttribute attribute: attributes.values()) {
			attribute.accept(visitor, this);
		}
		/*
		 * Visit the events.
		 */
		for (XEvent event: this) {
			event.accept(visitor, this);
		}
		/*
		 * Last call.
		 */
		visitor.visitTracePost(this, log);
	}
25707
void accepting()
      throws TimeoutException, InterruptedException, IOException,
      ExecutionException {
    // Initialization.
    acceptingInit();
    // The last time of HEARTBEAT message comes from leader.
    long lastHeartbeatTime = System.nanoTime();
    long ackEpoch = persistence.getAckEpoch();
    try {
      while (true) {
        MessageTuple tuple = filter.getMessage(config.getTimeoutMs());
        Message msg = tuple.getMessage();
        String source = tuple.getServerId();
        // The follower only expect receiving message from leader and
        // itself(REQUEST).
        if (source.equals(this.electedLeader)) {
          lastHeartbeatTime = System.nanoTime();
        } else {
          // Checks if the leader is alive.
          long timeDiff = (System.nanoTime() - lastHeartbeatTime) / 1000000;
          if ((int)timeDiff >= this.config.getTimeoutMs()) {
            // HEARTBEAT timeout.
            LOG.warn("Detects there's a timeout in waiting"
                + "message from leader {}, goes back to leader electing",
                this.electedLeader);
            throw new TimeoutException("HEARTBEAT timeout!");
          }
          if (msg.getType() == MessageType.QUERY_LEADER) {
            LOG.debug("Got QUERY_LEADER from {}", source);
            Message reply = MessageBuilder.buildQueryReply(this.electedLeader);
            sendMessage(source, reply);
          } else if (msg.getType() == MessageType.ELECTION_INFO) {
            this.election.reply(tuple);
          } else if (msg.getType() == MessageType.DELIVERED) {
            // DELIVERED message should come from itself.
            onDelivered(msg);
          } else if (msg.getType() == MessageType.SNAPSHOT) {
            snapProcessor.processRequest(tuple);
          } else if (msg.getType() == MessageType.SNAPSHOT_DONE) {
            commitProcessor.processRequest(tuple);
          } else {
            LOG.debug("Got unexpected message from {}, ignores.", source);
          }
          continue;
        }
        if (msg.getType() != MessageType.HEARTBEAT && LOG.isDebugEnabled()) {
          LOG.debug("Got message {} from {}",
                    TextFormat.shortDebugString(msg), source);
        }
        if (msg.getType() == MessageType.PROPOSAL) {
          Transaction txn = MessageBuilder.fromProposal(msg.getProposal());
          Zxid zxid = txn.getZxid();
          if (zxid.getEpoch() == ackEpoch) {
            onProposal(tuple);
          } else {
            LOG.debug("The proposal has the wrong epoch {}, expecting {}.",
                      zxid.getEpoch(), ackEpoch);
            throw new RuntimeException("The proposal has wrong epoch number.");
          }
        } else if (msg.getType() == MessageType.COMMIT) {
          commitProcessor.processRequest(tuple);
        } else if (msg.getType() == MessageType.HEARTBEAT) {
          LOG.trace("Got HEARTBEAT from {}.", source);
          // Replies HEARTBEAT message to leader.
          Message heartbeatReply = MessageBuilder.buildHeartbeat();
          sendMessage(source, heartbeatReply);
        } else if (msg.getType() == MessageType.FLUSH) {
          onFlush(tuple);
        } else {
          if (LOG.isWarnEnabled()) {
            LOG.warn("Unexpected messgae : {} from {}",
                     TextFormat.shortDebugString(msg),
                     source);
          }
        }
      }
    } finally {
      commitProcessor.shutdown();
      syncProcessor.shutdown();
      snapProcessor.shutdown();
      this.lastDeliveredZxid = commitProcessor.getLastDeliveredZxid();
      this.participantState.updateLastDeliveredZxid(this.lastDeliveredZxid);
    }
  }
200211
public boolean accept(File file) {
        if( !WatcherUtils.isInDirectory(file, javaSourceDir) || !WatcherUtils.hasExtension(file,"java")){
            return false;
        }

        // If the file has been deleted by may have been a controller, return true.
        // The cleanup will be applied.
        if (! file.isFile()) {
            return true;
        }

        //Parse the Java File and check if it's a wisdom Controller
        try {
            final CompilationUnit parse = JavaParser.parse(file);
            // The visitor return a Boolean object, potentially null.
            final Boolean accept = parse.accept(CLASS_VISITOR, null);
            return accept != null  && accept;
        } catch (Exception e) {
            getLog().error("Cannot parse  " + file.getAbsolutePath(), e);
            return false;
        }
    }
130079
public final boolean roll(final LoggingEvent loggingEvent) {
    for (int i = 0; i < this.fileRollables.length; i++) {
      if (this.fileRollables[i].roll(loggingEvent)) {
        return true;
      }
    }
    return false;
  }
493503
def _filter(self, value):
        
        if self.ignores and value in self.ignores:
            return False
        return True
652527
public LogEventFilter withCheckpoint(String from, int take) {
        parameters.put("from", from);
        parameters.put("take", take);
        return this;
    }
172039
@Override
	public boolean acceptsEvent(String type, Object event, Function<String, String> resolver) {
		return false;
	}
1154651
@Subscribe
    public final void receive(final LogEvent logEvent) {
        final String sClassName = logEvent.getSource().getClass().getName();

        Logger logger = loggersMap.get(sClassName);

        if (logger == null) {
            logger = LoggerFactory.getLogger(logEvent.getSource().getClass());
            loggersMap.put(sClassName, logger);
        }

        final Throwable error = logEvent.getCause();

        switch (logEvent.getLogType()) {
        case TRACE:
            logger.trace(logEvent.getMessage(), error);
            break;
        case DEBUG:
            logger.debug(logEvent.getMessage(), error);
            break;
        case INFO:
            logger.info(logEvent.getMessage(), error);
            break;
        case WARNING:
            logger.warn(logEvent.getMessage(), error);
            break;
        case ERROR:
            logger.error(logEvent.getMessage(), error);
            break;
        case FATAL:
            logger.error(logEvent.getMessage(), error);
            break;
        }
    }
336207
@Override
    public boolean accept(File pathname) {
        try {
            final boolean filesMatched = super.getFilesMatched();
            final boolean accepted = super.accept(pathname);
            if (accepted && filters != null && FileContentSearch.contains(pathname, filters)) {
                if (!filesMatched) {
                    super.setFilesMatched(filesMatched);
                }
                return false;
            }
            return accepted;
        } catch (IOException ex) {
            LOGGER.warn(String.format("Error testing file %s", pathname), ex);
        }
        return false;
    }
1210642
@Override
    public boolean accept(File pathname) {
        final FileFilter filter = getFileFilter();
        boolean accepted = false;
        if (null == filter) {
            LOGGER.error("The '{}' analyzer is misconfigured and does not have a file filter; it will be disabled", getName());
        } else if (this.isEnabled()) {
            accepted = filter.accept(pathname);
            if (accepted) {
                filesMatched = true;
            }
        }
        return accepted;
    }