forked from I2P_Developers/i2p.i2p
LogConsoleBuffer cleanup
This commit is contained in:
@ -44,13 +44,16 @@ public class LogsHelper extends HelperBase {
|
||||
}
|
||||
******/
|
||||
|
||||
private String formatMessages(List msgs) {
|
||||
/** formats in reverse order */
|
||||
private String formatMessages(List<String> msgs) {
|
||||
if (msgs.isEmpty())
|
||||
return "<p><i>" + _("No log messages") + "</i></p>";
|
||||
boolean colorize = Boolean.valueOf(_context.getProperty("routerconsole.logs.color")).booleanValue();
|
||||
StringBuilder buf = new StringBuilder(16*1024);
|
||||
buf.append("<ul>");
|
||||
buf.append("<code>\n");
|
||||
for (int i = msgs.size(); i > 0; i--) {
|
||||
String msg = (String)msgs.get(i - 1);
|
||||
String msg = msgs.get(i - 1);
|
||||
buf.append("<li>");
|
||||
if (colorize) {
|
||||
String color;
|
||||
|
@ -11,8 +11,8 @@ import net.i2p.I2PAppContext;
|
||||
*/
|
||||
public class LogConsoleBuffer {
|
||||
private I2PAppContext _context;
|
||||
private final List _buffer;
|
||||
private final List _critBuffer;
|
||||
private final List<String> _buffer;
|
||||
private final List<String> _critBuffer;
|
||||
|
||||
public LogConsoleBuffer(I2PAppContext context) {
|
||||
_context = context;
|
||||
@ -43,7 +43,7 @@ public class LogConsoleBuffer {
|
||||
* in the logs)
|
||||
*
|
||||
*/
|
||||
public List getMostRecentMessages() {
|
||||
public List<String> getMostRecentMessages() {
|
||||
synchronized (_buffer) {
|
||||
return new ArrayList(_buffer);
|
||||
}
|
||||
@ -54,9 +54,9 @@ public class LogConsoleBuffer {
|
||||
* in the logs)
|
||||
*
|
||||
*/
|
||||
public List getMostRecentCriticalMessages() {
|
||||
public List<String> getMostRecentCriticalMessages() {
|
||||
synchronized (_critBuffer) {
|
||||
return new ArrayList(_critBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user