Skip to content

Commit

Permalink
Proper serf debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Oct 16, 2018
1 parent f1aaecc commit aed2f44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,13 @@ func (a *Agent) setupSerf() (*serf.Serf, error) {
// Start Serf
log.Info("agent: Dkron agent starting")

serfConfig.LogOutput = ioutil.Discard
serfConfig.MemberlistConfig.LogOutput = ioutil.Discard
if log.Logger.Level == logrus.DebugLevel {
serfConfig.LogOutput = log.Logger.Writer()
serfConfig.MemberlistConfig.LogOutput = log.Logger.Writer()
} else {
serfConfig.LogOutput = ioutil.Discard
serfConfig.MemberlistConfig.LogOutput = ioutil.Discard
}

// Create serf first
serf, err := serf.Create(serfConfig)
Expand Down

0 comments on commit aed2f44

Please sign in to comment.