diff --git a/core/java/src/net/i2p/util/LogWriterBase.java b/core/java/src/net/i2p/util/LogWriterBase.java index 117e2786ff10ef0c5cfd50c96d59750dbcf2f0b9..053cccdc60a8be1bc101810861359a94eb5aa4f6 100644 --- a/core/java/src/net/i2p/util/LogWriterBase.java +++ b/core/java/src/net/i2p/util/LogWriterBase.java @@ -97,8 +97,7 @@ abstract class LogWriterBase implements Runnable { dupCount++; } else { if (dupCount > 0) { - writeRecord(_last.getPriority(), dupMessage(dupCount, _last, false)); - _manager.getBuffer().add(dupMessage(dupCount, _last, true)); + writeDupMessage(dupCount, _last); dupCount = 0; } writeRecord(rec); @@ -106,8 +105,7 @@ abstract class LogWriterBase implements Runnable { _last = rec; } if (dupCount > 0) { - writeRecord(_last.getPriority(), dupMessage(dupCount, _last, false)); - _manager.getBuffer().add(dupMessage(dupCount, _last, true)); + writeDupMessage(dupCount, _last); } flushWriter(); } @@ -125,6 +123,21 @@ abstract class LogWriterBase implements Runnable { } } + /** + * Write a msg with the date stamp of the last duplicate + * @since 0.9.21 + */ + private void writeDupMessage(int dupCount, LogRecord lastRecord) { + String dmsg = dupMessage(dupCount, lastRecord, false); + writeRecord(lastRecord.getPriority(), dmsg); + if (_manager.getDisplayOnScreenLevel() <= lastRecord.getPriority() && _manager.displayOnScreen()) + System.out.print(dmsg); + dmsg = dupMessage(dupCount, lastRecord, true); + _manager.getBuffer().add(dmsg); + if (lastRecord.getPriority() >= Log.CRIT) + _manager.getBuffer().addCritical(dmsg); + } + /** * Return a msg with the date stamp of the last duplicate * @since 0.9.3