Skip to content

Commit

Permalink
update log
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Jun 8, 2024
1 parent 4606afc commit c1024c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/util/cmd/find-trie-root/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/hex"
"fmt"
"math"
"os"

prometheusWAL "github.com/onflow/wal/wal"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -85,8 +86,8 @@ func searchRootHashInSegments(
dir string,
wantFrom, wantTo int,
) (int, int64, error) {
log := zerolog.Logger{}
w, err := prometheusWAL.NewSize(log, prometheus.DefaultRegisterer, dir, wal.SegmentSize, false)
lg := zerolog.New(os.Stderr).With().Timestamp().Logger()
w, err := prometheusWAL.NewSize(lg, prometheus.DefaultRegisterer, dir, wal.SegmentSize, false)
if err != nil {
return 0, 0, fmt.Errorf("cannot create WAL: %w", err)
}
Expand Down Expand Up @@ -120,7 +121,7 @@ func searchRootHashInSegments(
Int("want-to", wantTo).
Msgf("searching for trie root hash %x in segments [%d,%d]", expectedHash, wantFrom, wantTo)

sr, err := prometheusWAL.NewSegmentsRangeReader(log, prometheusWAL.SegmentRange{
sr, err := prometheusWAL.NewSegmentsRangeReader(lg, prometheusWAL.SegmentRange{
Dir: w.Dir(),
First: from,
Last: to,
Expand Down

0 comments on commit c1024c2

Please sign in to comment.