Class LogSubscriber


  • public abstract class LogSubscriber
    extends java.util.Observable
    Provides the interfaces for any log subscriber, including custom ones.
    • Constructor Summary

      Constructors 
      Constructor Description
      LogSubscriber​(java.lang.String name, LogLevel autoSubscribeLevel)
      Creates a new log subscriber with a name and log level.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Terminates this subscriber and unsubscribes from all log nodes.
      LogLevel getAutoSubscribeLevel()
      Returns the log level that will be used to automatically subscribe to new log nodes.
      java.lang.String getDescription()
      Returns the description of this log subscriber.
      java.lang.String getName()
      Returns the name of this log subscriber.
      java.util.Map<ILogNode,​LogLevel> getSubscriptions()
      Returns all log nodes that this subscriber subscribed to and the corresponding log levels.
      abstract void processMessage​(LogMessage message)
      Method that is called for each log message that is logged.
      void setAutoSubscribeLevel​(LogLevel level)
      Sets the log level to which to subscribe to automatically.
      void subscribe​(ILogNode node, LogLevel level)
      Subscribes this subscriber to the specified log node at the specified level.
      void unsubscribe()
      Unsubscribes this subscriber from all subscribed log nodes.
      void unsubscribe​(ILogNode node)
      Unsubscribes this subscriber from the specified log node.
      • Methods inherited from class java.util.Observable

        addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LogSubscriber

        public LogSubscriber​(java.lang.String name,
                             LogLevel autoSubscribeLevel)
        Creates a new log subscriber with a name and log level.
        Parameters:
        name - the name of the log subscriber
        autoSubscribeLevel - the log level to subscribe to
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of this log subscriber.
      • getDescription

        public java.lang.String getDescription()
        Returns the description of this log subscriber.
      • processMessage

        public abstract void processMessage​(LogMessage message)
        Method that is called for each log message that is logged.
        Parameters:
        message - the log message to process
      • getAutoSubscribeLevel

        public LogLevel getAutoSubscribeLevel()
        Returns the log level that will be used to automatically subscribe to new log nodes.
      • setAutoSubscribeLevel

        public void setAutoSubscribeLevel​(LogLevel level)
        Sets the log level to which to subscribe to automatically.
        Parameters:
        level - the log level to set
      • subscribe

        public void subscribe​(ILogNode node,
                              LogLevel level)
        Subscribes this subscriber to the specified log node at the specified level.
        Parameters:
        node - the log node to subscribe to
        level - the log level at which to subscribe
      • unsubscribe

        public void unsubscribe​(ILogNode node)
        Unsubscribes this subscriber from the specified log node.
        Parameters:
        node - the log node to subscribe to
      • unsubscribe

        public void unsubscribe()
        Unsubscribes this subscriber from all subscribed log nodes.
      • destroy

        public void destroy()
        Terminates this subscriber and unsubscribes from all log nodes.
      • getSubscriptions

        public java.util.Map<ILogNode,​LogLevel> getSubscriptions()
        Returns all log nodes that this subscriber subscribed to and the corresponding log levels.