Skip to content

Commit

Permalink
GH-203 - Properly aggregate log output.
Browse files Browse the repository at this point in the history
We now consider the expanded message in the comparator sorting the log entries by their messages.
  • Loading branch information
odrotbohm committed Dec 4, 2023
1 parent 3e32901 commit 20d1eab
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ public int compareTo(LogEntry o) {

Comparator<LogEntry> comparator = Comparator
.comparing(LogEntry::getModule)
.thenComparing(LogEntry::getMessage);
.thenComparing(LogEntry::getExpandedMessage);

return comparator.compare(this, o);
}

private String getExpandedMessage() {
return String.format(message.replace("{}", "%s"), parameters);
}
}
}

0 comments on commit 20d1eab

Please sign in to comment.