Browse Source

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.
Brian Waldon 12 years ago
parent
commit
b0cdf73565
2 changed files with 6 additions and 1 deletions
  1. 4 1
      etcd.go
  2. 2 0
      server/config.go

+ 4 - 1
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 {

+ 2 - 0
server/config.go

@@ -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, "")