feat(logging): Add VeryVeryVerbose opt to control raft trace info
Set very_very_verbose=true in a config file or use the -vvv CLI option to get raft trace logs in addition to etcd debug logs.release-0.4
parent
c64c739fab
commit
b0cdf73565
5
etcd.go
5
etcd.go
|
@ -43,7 +43,10 @@ func main() {
|
|||
}
|
||||
|
||||
// Enable options.
|
||||
if config.VeryVerbose {
|
||||
if config.VeryVeryVerbose {
|
||||
log.Verbose = true
|
||||
raft.SetLogLevel(raft.Trace)
|
||||
} else if config.VeryVerbose {
|
||||
log.Verbose = true
|
||||
raft.SetLogLevel(raft.Debug)
|
||||
} else if config.Verbose {
|
||||
|
|
|
@ -67,6 +67,7 @@ type Config struct {
|
|||
ShowVersion bool
|
||||
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
|
||||
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
|
||||
VeryVeryVerbose bool `toml:"very_very_verbose" env:"ETCD_VERY_VERY_VERBOSE"`
|
||||
Peer struct {
|
||||
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
|
||||
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
|
||||
|
@ -214,6 +215,7 @@ func (c *Config) LoadFlags(arguments []string) error {
|
|||
|
||||
f.BoolVar(&c.Verbose, "v", c.Verbose, "")
|
||||
f.BoolVar(&c.VeryVerbose, "vv", c.Verbose, "")
|
||||
f.BoolVar(&c.VeryVeryVerbose, "vvv", c.VeryVeryVerbose, "")
|
||||
|
||||
f.StringVar(&peers, "peers", "", "")
|
||||
f.StringVar(&c.PeersFile, "peers-file", c.PeersFile, "")
|
||||
|
|
Loading…
Reference in New Issue