Package 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 Description LogConsoleBuffer(int limit)LogConsoleBuffer(I2PAppContext context)Uses default limit from LogManager. -
Method Summary
Modifier and Type Method Description (package private) voidadd(String msg)(package private) voidaddCritical(String msg)Only adds to the critical buffer, not to both.voidclear()UIMessagesgetCriticalUIMessages()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...UIMessagesgetUIMessages()Retrieve the currently buffered messages, earlier values were generated...
-
Constructor Details
-
LogConsoleBuffer
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 Details
-
add
-
addCritical
Only adds to the critical buffer, not to both. -
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
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
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
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
-