Skip to content

Commit

Permalink
aider: Added startup logs to BeaconValidatorsDeriver.
Browse files Browse the repository at this point in the history
# Aider chat conversation:

USER: Add logs to the startup of the deriver

ASSISTANT: To add logs to the startup of the deriver, we will add logging statements in the `Start` method of the `BeaconValidatorsDeriver` struct in `pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go`.

Here is the *SEARCH/REPLACE* block:

pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go
```go
<<<<<<< SEARCH
	if !b.cfg.Enabled {
		b.log.Info("Validator states deriver disabled")

		return nil
	}

	b.log.Info("Validator states deriver enabled")
=======
	b.log.WithFields(logrus.Fields{
		"chunk_size": b.cfg.ChunkSize,
		"enabled":    b.cfg.Enabled,
	}).Info("Starting BeaconValidatorsDeriver")

	if !b.cfg.Enabled {
		b.log.Info("Validator states deriver disabled")
		return nil
	}

	b.log.Info("Validator states deriver enabled")
>>>>>>> REPLACE
```

This will add a log statement at the start of the `Start` method, logging the chunk size and whether the deriver is enabled.
  • Loading branch information
samcm committed Jun 11, 2024
1 parent 5711930 commit 48d2cd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ func (b *BeaconValidatorsDeriver) OnEventsDerived(ctx context.Context, fn func(c
}

func (b *BeaconValidatorsDeriver) Start(ctx context.Context) error {
b.log.WithFields(logrus.Fields{
"chunk_size": b.cfg.ChunkSize,
"enabled": b.cfg.Enabled,
}).Info("Starting BeaconValidatorsDeriver")

if !b.cfg.Enabled {
b.log.Info("Validator states deriver disabled")

return nil
}

Expand Down

0 comments on commit 48d2cd0

Please sign in to comment.