Class SuppressLog<T>


  • public class SuppressLog<T>
    extends java.lang.Object
    Log (using SuppressCache) which suppresses (certain) messages from the same member for a given time
    Since:
    3.2
    Author:
    Bela Ban
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SuppressLog.Level  
    • Constructor Summary

      Constructors 
      Constructor Description
      SuppressLog​(Log log)  
      SuppressLog​(Log log, java.lang.String message_key)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String createMessage​(SuppressCache.Value val, java.lang.String format, java.lang.Object... args)  
      void error​(T key, long timeout, java.lang.Object... args)  
      void error​(T key, long timeout, java.lang.String format, java.lang.Object... args)  
      SuppressCache<T> getCache()  
      protected void log​(SuppressLog.Level level, java.lang.String message)  
      void log​(SuppressLog.Level level, T key, long timeout, java.lang.Object... args)
      Logs a message from a given member if is hasn't been logged for timeout ms
      void log​(SuppressLog.Level level, T key, long timeout, java.lang.String format, java.lang.Object... args)  
      void removeExpired​(long timeout)  
      void trace​(T key, long timeout, java.lang.Object... args)  
      void trace​(T key, long timeout, java.lang.String format, java.lang.Object... args)  
      void warn​(T key, long timeout, java.lang.Object... args)  
      void warn​(T key, long timeout, java.lang.String format, java.lang.Object... args)  
      • Methods inherited from class java.lang.Object

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

      • log

        protected final Log log
      • message_format

        protected final java.lang.String message_format
      • suppress_format

        protected final java.lang.String suppress_format
    • Constructor Detail

      • SuppressLog

        public SuppressLog​(Log log,
                           java.lang.String message_key)
      • SuppressLog

        public SuppressLog​(Log log)
    • Method Detail

      • log

        public void log​(SuppressLog.Level level,
                        T key,
                        long timeout,
                        java.lang.Object... args)
        Logs a message from a given member if is hasn't been logged for timeout ms
        Parameters:
        level - The level, either warn or error
        key - The key into the SuppressCache, e.g. a member address or other topic ("thread_pool_full")
        timeout - The timeout
        args - The arguments to the message key
      • log

        public void log​(SuppressLog.Level level,
                        T key,
                        long timeout,
                        java.lang.String format,
                        java.lang.Object... args)
      • error

        public void error​(T key,
                          long timeout,
                          java.lang.Object... args)
      • warn

        public void warn​(T key,
                         long timeout,
                         java.lang.Object... args)
      • trace

        public void trace​(T key,
                          long timeout,
                          java.lang.Object... args)
      • error

        public void error​(T key,
                          long timeout,
                          java.lang.String format,
                          java.lang.Object... args)
      • warn

        public void warn​(T key,
                         long timeout,
                         java.lang.String format,
                         java.lang.Object... args)
      • trace

        public void trace​(T key,
                          long timeout,
                          java.lang.String format,
                          java.lang.Object... args)
      • createMessage

        protected java.lang.String createMessage​(SuppressCache.Value val,
                                                 java.lang.String format,
                                                 java.lang.Object... args)
      • removeExpired

        public void removeExpired​(long timeout)