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
|
AdvertiseAddress string
|
||||||
// Peers is a local cache of peer members
|
// Peers is a local cache of peer members
|
||||||
Peers []string
|
Peers []string
|
||||||
|
// Debug output for memberlist
|
||||||
|
Debug bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Agent) Config() *Config {
|
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.Delegate = NewAgentDelegate(cfg.NodeName, cfg.Address, peerUpdateChan, nodeEventChan)
|
||||||
mc.Events = NewEventHandler(nodeEventChan)
|
mc.Events = NewEventHandler(nodeEventChan)
|
||||||
|
|
||||||
// disable logging for memberlist
|
if !cfg.Debug {
|
||||||
// TODO: enable if debug
|
|
||||||
mc.Logger = log.New(ioutil.Discard, "", 0)
|
mc.Logger = log.New(ioutil.Discard, "", 0)
|
||||||
|
}
|
||||||
|
|
||||||
host, port, err := net.SplitHostPort(cfg.ClusterAddress)
|
host, port, err := net.SplitHostPort(cfg.ClusterAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue