osbase/logtree: add WithBacklogOrder
By moving the log entry reversal to the logtree.LogReader,
the behavior of getEntries and scanEntries changed. This is
fine as there are no other consumers for these functions outside of
logtree and the reader keeps the previous behavior, but also allows
to skip it.
Change-Id: If1fddd14d43aca64009655b978d6a05dd910eb50
Reviewed-on: https://review.monogon.dev/c/monogon/+/4447
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/osbase/logtree/journal_test.go b/osbase/logtree/journal_test.go
index 826f2e7..944e4fb 100644
--- a/osbase/logtree/journal_test.go
+++ b/osbase/logtree/journal_test.go
@@ -38,7 +38,7 @@
t.Fatalf("wanted %d entries, got %d", want, got)
}
for i, entry := range entries {
- want := fmt.Sprintf("test %d", (9000-defaultDNQuota)+i)
+ want := fmt.Sprintf("test %d", 9000-1-i)
got := strings.Join(entry.leveled.messages, "\n")
if want != got {
t.Fatalf("wanted entry %q, got %q", want, got)