net.i2p.util

## Class LogConsoleBuffer

- java.lang.Object
- - net.i2p.util.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 Summary

    Constructors
    Constructor and Description
    `LogConsoleBuffer(I2PAppContext context)` Uses default limit from LogManager.
    `LogConsoleBuffer(int limit)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `add(String msg)`
    `(package private) void` | `addCritical(String msg)` Only adds to the critical buffer, not to both.
    `void` | `clear()` Clear all log entries from the buffer.
    `UIMessages` | `getCriticalUIMessages()` Retrieve the currently buffered critical messages, earlier values were generated...
    `List<String>` | `getMostRecentCriticalMessages()` Retrieve the currently buffered critical messages, earlier values were generated...
    `List<String>` | `getMostRecentMessages()` Retrieve the currently buffered messages, earlier values were generated...
    `UIMessages` | `getUIMessages()` Retrieve the currently buffered messages, earlier values were generated...

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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.

  - ### Method Detail

    - #### add

          void add(String msg)

    - #### addCritical

          void addCritical(String msg)

      Only adds to the critical buffer, not to both.

    - #### clear

          public void clear()

      Clear all log entries from the buffer.

    - #### 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

    - #### 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

    - #### 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

    - #### 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