Add debug config option
This commit is contained in:
parent
d597ca32bd
commit
8eb32d9bde
1 changed files with 5 additions and 3 deletions
|
@ -35,6 +35,8 @@ type Config struct {
|
|||
AdvertiseAddress string
|
||||
// Peers is a local cache of peer members
|
||||
Peers []string
|
||||
// Debug output for memberlist
|
||||
Debug bool
|
||||
}
|
||||
|
||||
func (a *Agent) Config() *Config {
|
||||
|
@ -58,9 +60,9 @@ func (cfg *Config) memberListConfig(peerUpdateChan chan bool, nodeEventChan chan
|
|||
mc.Delegate = NewAgentDelegate(cfg.NodeName, cfg.Address, peerUpdateChan, nodeEventChan)
|
||||
mc.Events = NewEventHandler(nodeEventChan)
|
||||
|
||||
// disable logging for memberlist
|
||||
// TODO: enable if debug
|
||||
if !cfg.Debug {
|
||||
mc.Logger = log.New(ioutil.Discard, "", 0)
|
||||
}
|
||||
|
||||
host, port, err := net.SplitHostPort(cfg.ClusterAddress)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue