Class LogMessageFilter

    • Constructor Detail

      • LogMessageFilter

        public LogMessageFilter()
    • Method Detail

      • acceptMessage

        public abstract boolean acceptMessage​(@NotNull
                                              LogMessage message,
                                              boolean lastMessageInParent)
        Called if simple log message appeared.
        Parameters:
        message - message to filter
        lastMessageInParent - true if this is the last message in parent block
        Returns:
        true if message accepted and false if message should be removed. If message is accepted then all its parents are accepted too.
      • acceptBlockMessage

        public boolean acceptBlockMessage​(@NotNull
                                          BlockLogMessage message,
                                          boolean lastMessageInParent)
        Called if block log message appeared. By default calls acceptMessage() method.
        Parameters:
        message - message to filter
        lastMessageInParent - true if this is the last message in parent block
        Returns:
        true if message accepted and false if message should be removed. If message is accepted then all its parents are accepted too.
      • postProcess

        @NotNull
        public List<LogMessage> postProcess​(@NotNull
                                            List<LogMessage> filteredMessages)
        Called before returning result.
        Parameters:
        filteredMessages - filtered messages
        Returns:
        post processed messages
      • filter

        @NotNull
        public List<LogMessage> filter​(@NotNull
                                       Iterator<LogMessage> iterator)
        Reads messages from iterator and filters them.
        Parameters:
        iterator - iterator to read messages from
        Returns:
        filtered messages.
      • rememberMessage

        protected void rememberMessage​(@NotNull
                                       List<LogMessage> filtered,
                                       @NotNull
                                       LogMessage message)
      • rememberStopLoadingMessage

        protected void rememberStopLoadingMessage​(@NotNull
                                                  List<LogMessage> filtered,
                                                  @NotNull
                                                  LogMessage stopLoadingMessage)
      • getStopLoadingMessage

        @NotNull
        protected LogMessage getStopLoadingMessage()
      • shouldCheckMaxListSize

        protected boolean shouldCheckMaxListSize()
        Returns true if should check maximum list size, false otherwise
        Returns:
        true if should check maximum list size, false otherwise
      • getListForStoringMessages

        @NotNull
        protected List<LogMessage> getListForStoringMessages​(int maxImportantListSize)
        Returns list for storing log messages
        Parameters:
        maxImportantListSize - maximal important list size
        Returns:
        list for storing log messages
      • appendMessageWithParents

        protected void appendMessageWithParents​(@NotNull
                                                LogMessage message,
                                                @NotNull
                                                List<LogMessage> filtered)
        Appends message and all its parents to the list. Only those parents are appended which are not already in the list.
        Parameters:
        message - message to append
        filtered - list where to append message