Skip to content

Commit

Permalink
Using the proper config logger
Browse files Browse the repository at this point in the history
  • Loading branch information
AnomalRoil committed Mar 7, 2022
1 parent 9b7b0cc commit 09c987c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions core/drand_beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"time"

"github.com/drand/drand/common"
"github.com/drand/drand/log"

"github.com/drand/drand/chain"
"github.com/drand/drand/chain/boltdb"
Expand Down Expand Up @@ -291,7 +290,7 @@ func (bp *BeaconProcess) newBeacon() (*beacon.Handler, error) {
return nil, err
}

logger := log.DefaultLogger().With("idx", node.Index, "addr", pub.Addr, "beacon_id", bp.group.ID)
logger := bp.opts.logger.With("idx", node.Index, "addr", pub.Addr, "beacon_id", bp.group.ID)
bp.log = logger

b, err := beacon.NewHandler(bp.privGateway.ProtocolClient, store, conf, logger, bp.version)
Expand Down
4 changes: 1 addition & 3 deletions core/drand_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ func NewDrandDaemon(c *Config) (*DrandDaemon, error) {
beaconID = common.DefaultBeaconID
}

// drandDaemon.log = logger.With("beacon_id", beaconID)

drandDaemon.state.Lock()
bp, isPresent := drandDaemon.beaconProcesses[beaconID]
drandDaemon.state.Unlock()
Expand Down Expand Up @@ -107,7 +105,7 @@ func (dd *DrandDaemon) init() error {
privAddr := c.PrivateListenAddress("")
pubAddr := c.PublicListenAddress("")

dd.log = log.DefaultLogger().With("addr", privAddr)
dd.log = c.logger.With("addr", privAddr)

if privAddr == "" {
return fmt.Errorf("private listen address cannot be empty")
Expand Down

0 comments on commit 09c987c

Please sign in to comment.