Skip to content

Commit e977e34

Browse files
committed
Improve batch processing log
1 parent a9dfa79 commit e977e34

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

codegenerator/cli/templates/static/codegen/src/EventProcessing.res

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -373,23 +373,17 @@ let processEventBatch = async (
373373
// Compute chains state for this batch
374374
let chains: Internal.chains = chainFetchers->computeChainsState
375375

376-
let logger = Logging.createChildFrom(
377-
~logger=Logging.getLogger(),
378-
~params={
379-
"totalBatchSize": totalBatchSize,
380-
"byChain": batch.progressedChainsById->Utils.Dict.filterMapValues(chainAfterBatch =>
381-
if chainAfterBatch.batchSize > 0 {
382-
Some({
383-
"batchSize": chainAfterBatch.batchSize,
384-
"toBlockNumber": chainAfterBatch.progressBlockNumber,
385-
})
386-
} else {
387-
None
388-
}
389-
),
390-
},
391-
)
392-
logger->Logging.childTrace("Started processing batch")
376+
let logger = Logging.getLogger()
377+
logger->Logging.childTrace({
378+
"msg": "Started processing batch",
379+
"totalBatchSize": totalBatchSize,
380+
"chains": batch.progressedChainsById->Utils.Dict.mapValues(chainAfterBatch => {
381+
{
382+
"batchSize": chainAfterBatch.batchSize,
383+
"progress": chainAfterBatch.progressBlockNumber,
384+
}
385+
}),
386+
})
393387

394388
try {
395389
let timeRef = Hrtime.makeTimer()

0 commit comments

Comments
 (0)