add veryverbose to ouput raft debug info
parent
d1158f5a11
commit
0e6ebfa1f6
7
etcd.go
7
etcd.go
|
@ -27,6 +27,7 @@ import (
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
var verbose bool
|
var verbose bool
|
||||||
|
var veryVerbose bool
|
||||||
|
|
||||||
var machines string
|
var machines string
|
||||||
var machinesFile string
|
var machinesFile string
|
||||||
|
@ -58,6 +59,7 @@ var retryTimes int
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.BoolVar(&verbose, "v", false, "verbose logging")
|
flag.BoolVar(&verbose, "v", false, "verbose logging")
|
||||||
|
flag.BoolVar(&veryVerbose, "vv", false, "very verbose logging")
|
||||||
|
|
||||||
flag.StringVar(&machines, "C", "", "the ip address and port of a existing machines in the cluster, sepearate by comma")
|
flag.StringVar(&machines, "C", "", "the ip address and port of a existing machines in the cluster, sepearate by comma")
|
||||||
flag.StringVar(&machinesFile, "CF", "", "the file contains a list of existing machines in the cluster, seperate by comma")
|
flag.StringVar(&machinesFile, "CF", "", "the file contains a list of existing machines in the cluster, seperate by comma")
|
||||||
|
@ -154,6 +156,11 @@ var info *Info
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if veryVerbose {
|
||||||
|
verbose = true
|
||||||
|
raft.SetLogLevel(raft.Debug)
|
||||||
|
}
|
||||||
|
|
||||||
if machines != "" {
|
if machines != "" {
|
||||||
cluster = strings.Split(machines, ",")
|
cluster = strings.Split(machines, ",")
|
||||||
} else if machinesFile != "" {
|
} else if machinesFile != "" {
|
||||||
|
|
Loading…
Reference in New Issue