Interface ILogNode


  • public interface ILogNode
    A LogNode (a.k.a. Message Channel) represents a Node in the Publish/Subscribe logging system, that publishes messages to its subscribers.

    The LogNode implements quite a lot of convenience-functions, for logging. Input gets wrapped in a LogMessage object inside the Node.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void critical​(java.lang.Object message)
      Logs the specified message at the Critical level.
      void critical​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Critical level.
      void critical​(java.lang.Throwable cause)
      Logs the specified cause at the Critical level.
      void debug​(java.lang.Object message)
      Logs the specified message at the Debug level.
      void debug​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Debug level.
      void debug​(java.lang.Throwable cause)
      Logs the specified cause at the Debug level.
      void error​(java.lang.Object message)
      Logs the specified message at the Error level.
      void error​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Error level.
      void error​(java.lang.Throwable cause)
      Logs the specified cause at the Error level.
      java.util.Map<LogSubscriber,​LogLevel> getSubscribers()
      Returns all registered subscribers and the log level they subscribed to.
      void info​(java.lang.Object message)
      Logs the specified message at the Info level.
      void info​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Info level.
      void info​(java.lang.Throwable cause)
      Logs the specified cause at the Info level.
      boolean isDebugEnabled()
      Returns whether debug or trace is enabled.
      boolean isTraceEnabled()
      Returns whether trace is enabled.
      void log​(LogLevel level, java.lang.Object message)
      Logs the specified message if the level allows.
      void log​(LogLevel level, java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause if the level allows.
      void log​(LogLevel level, java.lang.Throwable cause)
      Logs the specified cause if the level allows.
      java.lang.String name()
      Returns the name of the log node.
      void subscribe​(LogSubscriber subscriber, LogLevel logLevel)
      Subscribes the specified subscriber to receive log events for the specified level and above.
      void trace​(java.lang.Object message)
      Logs the specified message at the Trace level.
      void trace​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Trace level.
      void trace​(java.lang.Throwable cause)
      Logs the specified cause at the Trace level.
      void unsubscribe()
      Unsubscribes all registered subscribers.
      void unsubscribe​(LogSubscriber subscriber)
      Unsubscribes the specified subscriber.
      void warn​(java.lang.Object message)
      Logs the specified message at the Warning level.
      void warn​(java.lang.Object message, java.lang.Throwable cause)
      Logs the specified message and cause at the Warning level.
      void warn​(java.lang.Throwable cause)
      Logs the specified cause at the Warning level.
    • Method Detail

      • name

        java.lang.String name()
        Returns the name of the log node.
        Returns:
        the log node name
      • isDebugEnabled

        boolean isDebugEnabled()
        Returns whether debug or trace is enabled.
        Returns:
        true if the log level is debug or trace, false otherwise
      • isTraceEnabled

        boolean isTraceEnabled()
        Returns whether trace is enabled.
        Returns:
        true if the log level is trace, false otherwise
      • log

        void log​(LogLevel level,
                 java.lang.Object message,
                 java.lang.Throwable cause)
        Logs the specified message and cause if the level allows.
        Parameters:
        level - the log level for the message
        message - the log message
        cause - the stack trace
      • log

        void log​(LogLevel level,
                 java.lang.Object message)
        Logs the specified message if the level allows.
        Parameters:
        level - the log level for the message
        message - the log message
      • log

        void log​(LogLevel level,
                 java.lang.Throwable cause)
        Logs the specified cause if the level allows.
        Parameters:
        level - the log level for the message
        cause - the stack trace
      • critical

        void critical​(java.lang.Object message,
                      java.lang.Throwable cause)
        Logs the specified message and cause at the Critical level.
        Parameters:
        message - the log message
        cause - the stack trace
      • critical

        void critical​(java.lang.Object message)
        Logs the specified message at the Critical level.
        Parameters:
        message - the log message
      • critical

        void critical​(java.lang.Throwable cause)
        Logs the specified cause at the Critical level.
        Parameters:
        cause - the stack trace
      • error

        void error​(java.lang.Object message,
                   java.lang.Throwable cause)
        Logs the specified message and cause at the Error level.
        Parameters:
        message - the log message
        cause - the stack trace
      • error

        void error​(java.lang.Object message)
        Logs the specified message at the Error level.
        Parameters:
        message - the log message
      • error

        void error​(java.lang.Throwable cause)
        Logs the specified cause at the Error level.
        Parameters:
        cause - the stack trace
      • warn

        void warn​(java.lang.Object message,
                  java.lang.Throwable cause)
        Logs the specified message and cause at the Warning level.
        Parameters:
        message - the log message
        cause - the stack trace
      • warn

        void warn​(java.lang.Object message)
        Logs the specified message at the Warning level.
        Parameters:
        message - the log message
      • warn

        void warn​(java.lang.Throwable cause)
        Logs the specified cause at the Warning level.
        Parameters:
        cause - the stack trace
      • info

        void info​(java.lang.Object message,
                  java.lang.Throwable cause)
        Logs the specified message and cause at the Info level.
        Parameters:
        message - the log message
        cause - the stack trace
      • info

        void info​(java.lang.Object message)
        Logs the specified message at the Info level.
        Parameters:
        message - the log message
      • info

        void info​(java.lang.Throwable cause)
        Logs the specified cause at the Info level.
        Parameters:
        cause - the stack trace
      • debug

        void debug​(java.lang.Object message,
                   java.lang.Throwable cause)
        Logs the specified message and cause at the Debug level.
        Parameters:
        message - the log message
        cause - the stack trace
      • debug

        void debug​(java.lang.Object message)
        Logs the specified message at the Debug level.
        Parameters:
        message - the log message
      • debug

        void debug​(java.lang.Throwable cause)
        Logs the specified cause at the Debug level.
        Parameters:
        cause - the stack trace
      • trace

        void trace​(java.lang.Object message,
                   java.lang.Throwable cause)
        Logs the specified message and cause at the Trace level.
        Parameters:
        message - the log message
        cause - the stack trace
      • trace

        void trace​(java.lang.Object message)
        Logs the specified message at the Trace level.
        Parameters:
        message - the log message
      • trace

        void trace​(java.lang.Throwable cause)
        Logs the specified cause at the Trace level.
        Parameters:
        cause - the stack trace
      • subscribe

        void subscribe​(LogSubscriber subscriber,
                       LogLevel logLevel)
        Subscribes the specified subscriber to receive log events for the specified level and above.
        Parameters:
        subscriber - the subscriber to register
        logLevel - the log level to subscribe to
      • unsubscribe

        void unsubscribe​(LogSubscriber subscriber)
        Unsubscribes the specified subscriber.
        Parameters:
        subscriber - the subscriber to unregister
      • unsubscribe

        void unsubscribe()
        Unsubscribes all registered subscribers.
      • getSubscribers

        java.util.Map<LogSubscriber,​LogLevel> getSubscribers()
        Returns all registered subscribers and the log level they subscribed to.