net.i2p.util
Class LogConsoleBuffer

java.lang.Object
  extended by 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
LogConsoleBuffer(I2PAppContext context)
          Uses default limit from LogManager.
LogConsoleBuffer(int limit)
           
 
Method Summary
(package private)  void add(String msg)
           
(package private)  void addCritical(String msg)
          Only adds to the critical buffer, not to both.
 void clear()
           
 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...
 
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.
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

clear

public void clear()
Since:
0.8.8