Skip to content

Commit 1b18ba2

Browse files
authored
logs(indexer)Clean up log format in head index progress messages (#31761)
updates the log entries in `core/filtermaps/indexer.go` to remove double quotes around keys like "first block" and "last block", changing them to `firstblock` and `lastblock`. This brings them in line with the general logging style used across the codebase, where log keys are unquoted single words. For example, the log: ` INFO [...] "first block"=..., "last block"=...` Is now rendered as: ` INFO [...] firstblock=..., lastblock=...` This change improves readability and maintains consistency with logs such as: ` INFO [...] number=2 sealhash=... uncles=0 txs=0 ...` No functional behavior is changed — this is purely a formatting cleanup for better developer experience.
1 parent 615d29f commit 1b18ba2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/filtermaps/indexer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func (f *FilterMaps) tryIndexHead() error {
254254
((!f.loggedHeadIndex && time.Since(f.startedHeadIndexAt) > headLogDelay) ||
255255
time.Since(f.lastLogHeadIndex) > logFrequency) {
256256
log.Info("Log index head rendering in progress",
257-
"first block", f.indexedRange.blocks.First(), "last block", f.indexedRange.blocks.Last(),
257+
"firstblock", f.indexedRange.blocks.First(), "lastblock", f.indexedRange.blocks.Last(),
258258
"processed", f.indexedRange.blocks.AfterLast()-f.ptrHeadIndex,
259259
"remaining", f.indexedView.HeadNumber()-f.indexedRange.blocks.Last(),
260260
"elapsed", common.PrettyDuration(time.Since(f.startedHeadIndexAt)))
@@ -266,7 +266,7 @@ func (f *FilterMaps) tryIndexHead() error {
266266
}
267267
if f.loggedHeadIndex && f.indexedRange.hasIndexedBlocks() {
268268
log.Info("Log index head rendering finished",
269-
"first block", f.indexedRange.blocks.First(), "last block", f.indexedRange.blocks.Last(),
269+
"firstblock", f.indexedRange.blocks.First(), "lastblock", f.indexedRange.blocks.Last(),
270270
"processed", f.indexedRange.blocks.AfterLast()-f.ptrHeadIndex,
271271
"elapsed", common.PrettyDuration(time.Since(f.startedHeadIndexAt)))
272272
}
@@ -323,7 +323,7 @@ func (f *FilterMaps) tryIndexTail() (bool, error) {
323323
if f.indexedRange.hasIndexedBlocks() && f.ptrTailIndex >= f.indexedRange.blocks.First() &&
324324
(!f.loggedTailIndex || time.Since(f.lastLogTailIndex) > logFrequency) {
325325
log.Info("Log index tail rendering in progress",
326-
"first block", f.indexedRange.blocks.First(), "last block", f.indexedRange.blocks.Last(),
326+
"firstblock", f.indexedRange.blocks.First(), "last block", f.indexedRange.blocks.Last(),
327327
"processed", f.ptrTailIndex-f.indexedRange.blocks.First()+tpb,
328328
"remaining", remaining,
329329
"next tail epoch percentage", f.indexedRange.tailPartialEpoch*100/f.mapsPerEpoch,
@@ -346,7 +346,7 @@ func (f *FilterMaps) tryIndexTail() (bool, error) {
346346
}
347347
if f.loggedTailIndex && f.indexedRange.hasIndexedBlocks() {
348348
log.Info("Log index tail rendering finished",
349-
"first block", f.indexedRange.blocks.First(), "last block", f.indexedRange.blocks.Last(),
349+
"firstblock", f.indexedRange.blocks.First(), "lastblock", f.indexedRange.blocks.Last(),
350350
"processed", f.ptrTailIndex-f.indexedRange.blocks.First(),
351351
"elapsed", common.PrettyDuration(time.Since(f.startedTailIndexAt)))
352352
f.loggedTailIndex = false

0 commit comments

Comments
 (0)