Browse Source

Simplify check sort displaying.

master
Christian P. MOMON 6 months ago
parent
commit
a0d78392fc
  1. 29
      src/fr/devinsy/logar/app/Logar.java

29
src/fr/devinsy/logar/app/Logar.java

@ -351,13 +351,13 @@ public final class Logar
{
System.out.println("== Check sort for [" + file.getName() + "]");
LocalDateTime currentDate = null;
int count = 0;
int lineCount = 0;
int badLineCount = 0;
int badGroupCount = 0;
LineIterator iterator = new LineIterator(file);
while (iterator.hasNext())
{
String line = iterator.next();
lineCount += 1;
LocalDateTime date = getLogDate(line);
if (currentDate == null)
{
@ -365,34 +365,13 @@ public final class Logar
}
else if (date.isBefore(currentDate))
{
count += 1;
System.out.println(String.format("detected line: %d %s", lineCount, currentDate.toString()));
badLineCount += 1;
}
else
{
currentDate = date;
if (count != 0)
{
System.out.println(String.format("detected lines: %d %s", count, currentDate.toString()));
badLineCount += count;
badGroupCount += 1;
count = 0;
}
}
}
if (count != 0)
{
System.out.println(String.format("detected lines: %d %s", count, currentDate.toString()));
badLineCount += count;
badGroupCount += 1;
count = 0;
}
if (badLineCount > 0)
{
System.out.println("Bad group count: " + badGroupCount);
System.out.println("Bad line count: " + badLineCount);
}
}

Loading…
Cancel
Save