Changeset 393b5937


Ignore:
Timestamp:
Dec 11, 2015 3:06:22 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2852383
Parents:
32df925
Message:

Logs: Windows line ending fixes for event log and duplicate message in router log

Files:
3 edited

Legend:

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

    r32df925 r393b5937  
    2323 */
    2424class LogRecordFormatter {
    25     private final static String NL = System.getProperty("line.separator");
     25    final static String NL = System.getProperty("line.separator");
    2626    // arbitrary max length for the classname property (this makes is it lines up nicely)
    2727    private final static int MAX_WHERE_LENGTH = 30;
  • core/java/src/net/i2p/util/LogWriterBase.java

    r32df925 r393b5937  
    148148        String arrows = reverse ? (SystemVersion.isAndroid() ? "vvv" : "&darr;&darr;&darr;") : "^^^";
    149149        return LogRecordFormatter.getWhen(_manager, lastRecord) + ' ' + arrows + ' ' +
    150                _t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows + '\n';
     150               _t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows +
     151               LogRecordFormatter.NL;
    151152    }
    152153   
  • router/java/src/net/i2p/router/util/EventLog.java

    r32df925 r393b5937  
    1616import net.i2p.data.DataHelper;
    1717import net.i2p.util.SecureFileOutputStream;
     18import net.i2p.util.SystemVersion;
    1819
    1920/**
     
    9596            if (info != null && info.length() > 0)
    9697                buf.append(' ').append(info);
     98            if (SystemVersion.isWindows())
     99                buf.append('\r');
    97100            buf.append('\n');
    98101            out.write(buf.toString().getBytes("UTF-8"));
     
    127130            while ( (line = br.readLine()) != null) {
    128131                try {
    129                     String[] s = DataHelper.split(line, " ", 3);
     132                    String[] s = DataHelper.split(line.trim(), " ", 3);
    130133                    if (!s[1].equals(event))
    131134                        continue;
     
    169172            while ( (line = br.readLine()) != null) {
    170173                try {
    171                     String[] s = DataHelper.split(line, " ", 2);
     174                    String[] s = DataHelper.split(line.trim(), " ", 2);
    172175                    if (s.length < 2)
    173176                        continue;
Note: See TracChangeset for help on using the changeset viewer.