Skip to content

Commit

Permalink
Merge pull request #71 from kaleido-io/log-tidy-up
Browse files Browse the repository at this point in the history
Add more clarity to logs for event enrichment failures
  • Loading branch information
peterbroadhurst authored Apr 27, 2023
2 parents f2769ce + ee9f5cb commit 9512b8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/ethereum/event_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ func (l *listener) filterEnrichEthLog(ctx context.Context, f *eventFilter, ethLo
if len(l.config.options.Methods) > 0 || l.config.options.Signer {
txInfo, err := l.c.getTransactionInfo(ctx, ethLog.TransactionHash)
if txInfo == nil || err != nil {
log.L(ctx).Errorf("Failed to get transaction info for TX '%s': %v", ethLog.TransactionHash, err)
if txInfo == nil {
log.L(ctx).Errorf("Failed to get transaction info for TX '%s': transaction hash not found", ethLog.TransactionHash)
} else {
log.L(ctx).Errorf("Failed to get transaction info for TX '%s': %v", ethLog.TransactionHash, err)
}
return nil, false, err // This is an error condition, rather than just something we cannot enrich
}
if l.config.options.Signer {
Expand Down
2 changes: 1 addition & 1 deletion internal/ethereum/event_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func (es *eventStream) leadGroupSteadyState() bool {
// Enrich the events
events, enrichErr := es.filterEnrichSort(es.ctx, ag, ethLogs)
if enrichErr != nil {
log.L(es.ctx).Errorf("Failed to enrich events: %s", enrichErr)
log.L(es.ctx).Errorf("Failed to enrich events: %v", enrichErr)
// We have to reset our filter, as otherwise we'll skip past these events.
filterResetRequired = true
failCount++
Expand Down

0 comments on commit 9512b8a

Please sign in to comment.