Package net.i2p.util

Class LogConsoleBuffer


  • public class LogConsoleBuffer
    extends Object
    Offer a glimpse into the last few console messages generated. Maintains two buffers, one normal and one critical.
    • Constructor Detail

      • LogConsoleBuffer

        public LogConsoleBuffer​(I2PAppContext context)
        Uses default limit from LogManager. As of 0.8.8, limit is not checked at runtime.
        Parameters:
        context - unused
      • LogConsoleBuffer

        public LogConsoleBuffer​(int limit)
        Parameters:
        limit - max size of each buffer In theory the limit is configurable, but it isn't in the UI, so set it at construction.
        Since:
        0.8.8
    • Method Detail

      • add

        void add​(String msg)
      • addCritical

        void addCritical​(String msg)
        Only adds to the critical buffer, not to both.
      • getMostRecentMessages

        public List<String> getMostRecentMessages()
        Retrieve the currently buffered messages, earlier values were generated... earlier. All values are strings with no formatting (as they are written in the logs)
        Returns:
        oldest first
      • getMostRecentCriticalMessages

        public List<String> getMostRecentCriticalMessages()
        Retrieve the currently buffered critical messages, earlier values were generated... earlier. All values are strings with no formatting (as they are written in the logs)
        Returns:
        oldest first
      • getUIMessages

        public UIMessages getUIMessages()
        Retrieve the currently buffered messages, earlier values were generated... earlier. All values are strings with no formatting (as they are written in the logs)
        Returns:
        oldest first
        Since:
        0.9.46
      • getCriticalUIMessages

        public UIMessages getCriticalUIMessages()
        Retrieve the currently buffered critical messages, earlier values were generated... earlier. All values are strings with no formatting (as they are written in the logs)
        Returns:
        oldest first
        Since:
        0.9.46
      • clear

        public void clear()
        Since:
        0.8.8