Class InMemoryLogger

java.lang.Object
com.reposilite.journalist.backend.DefaultLogger
com.reposilite.journalist.backend.InMemoryLogger
All Implemented Interfaces:
Journalist, Logger

public class InMemoryLogger extends DefaultLogger
Stores all messages in memory as a queue and does not print any message directly.
  • Constructor Details

    • InMemoryLogger

      public InMemoryLogger(Channel threshold)
    • InMemoryLogger

      public InMemoryLogger()
      Uses Channel.INFO as a default threshold.
  • Method Details

    • internalLog

      protected void internalLog(Channel channel, String message)
      Description copied from class: DefaultLogger
      Internal method used by DefaultLogger to send processed message to the final implementation.
      Specified by:
      internalLog in class DefaultLogger
      Parameters:
      channel - the channel to log to
      message - the message to log
    • contains

      public boolean contains(String message)
      Check if one of the stored messages contain the given text
      Parameters:
      message - the text to search for
      Returns:
      true if any stored message contains the given value, otherwise false
    • getMessages

      public Queue<? extends Map.Entry<Channel,String>> getMessages()
      Get all stored messages
      Returns:
      the list of stored messages