Changeset b76b2ef for core


Ignore:
Timestamp:
Feb 23, 2019 6:02:00 PM (14 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7ce539a
Parents:
32797dd4
Message:

Console: Flip order of router logs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/LogWriter.java

    r32797dd4 rb76b2ef  
    2525    private final static long MIN_FLUSH_INTERVAL = 2*1000;
    2626    private final static long MAX_FLUSH_INTERVAL = 5*60*1000;
     27    // true for newest first on /logs page; false for oldest first
     28    private static final boolean BUFFER_DISPLAYED_REVERSE = false;
    2729    private long _lastReadConfig;
    2830    protected final LogManager _manager;
     
    138140     */
    139141    private void writeDupMessage(int dupCount, LogRecord lastRecord) {
    140         String dmsg = dupMessage(dupCount, lastRecord, false);
     142        String dmsg = dupMessage(dupCount, lastRecord, false, false);
    141143        writeRecord(lastRecord.getPriority(), dmsg);
    142144        if (_manager.getDisplayOnScreenLevel() <= lastRecord.getPriority() && _manager.displayOnScreen())
    143145            System.out.print(dmsg);
    144         dmsg = dupMessage(dupCount, lastRecord, true);
     146        dmsg = dupMessage(dupCount, lastRecord, BUFFER_DISPLAYED_REVERSE, true);
    145147        _manager.getBuffer().add(dmsg);
    146148        if (lastRecord.getPriority() >= Log.CRIT)
     
    152154     *  @since 0.9.3
    153155     */
    154     private String dupMessage(int dupCount, LogRecord lastRecord, boolean reverse) {
    155         String arrows = reverse ? (SystemVersion.isAndroid() ? "vvv" : "&darr;&darr;&darr;") : "^^^";
     156    private String dupMessage(int dupCount, LogRecord lastRecord, boolean reverse, boolean html) {
     157        boolean nohtml = !html || SystemVersion.isAndroid();
     158        String arrows = reverse ? (nohtml ? "vvv" : "&darr;&darr;&darr;")
     159                                : (nohtml ? "^^^" : "&uarr;&uarr;&uarr;");
    156160        return LogRecordFormatter.getWhen(_manager, lastRecord) + ' ' + arrows + ' ' +
    157161               _t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows +
Note: See TracChangeset for help on using the changeset viewer.