mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tools/etcd-dump-logs: pass zap logger to raftsnap
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
b4565cc97b
commit
f523b0b33f
@ -36,9 +36,9 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
snapfile := flag.String("start-snap", "", "The base name of snapshot file to start dumping")
|
snapfile := flag.String("start-snap", "", "The base name of snapshot file to start dumping")
|
||||||
index := flag.Uint64("start-index", 0, "The index to start dumping")
|
index := flag.Uint64("start-index", 0, "The index to start dumping")
|
||||||
entrytype := flag.String("entry-type", "", `If set, filters output by entry type. Must be one or more than one of:
|
entrytype := flag.String("entry-type", "", `If set, filters output by entry type. Must be one or more than one of:
|
||||||
ConfigChange, Normal, Request, InternalRaftRequest,
|
ConfigChange, Normal, Request, InternalRaftRequest,
|
||||||
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
|
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
|
||||||
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke`)
|
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke`)
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -68,7 +68,7 @@ func main() {
|
|||||||
ss := raftsnap.New(zap.NewExample(), snapDir(dataDir))
|
ss := raftsnap.New(zap.NewExample(), snapDir(dataDir))
|
||||||
snapshot, err = ss.Load()
|
snapshot, err = ss.Load()
|
||||||
} else {
|
} else {
|
||||||
snapshot, err = raftsnap.Read(filepath.Join(snapDir(dataDir), *snapfile))
|
snapshot, err = raftsnap.Read(zap.NewExample(), filepath.Join(snapDir(dataDir), *snapfile))
|
||||||
}
|
}
|
||||||
|
|
||||||
switch err {
|
switch err {
|
||||||
@ -269,9 +269,9 @@ func evaluateEntrytypeFlag(entrytype string) []EntryFilter {
|
|||||||
if f, ok := validRequest[et]; ok {
|
if f, ok := validRequest[et]; ok {
|
||||||
filters = append(filters, f...)
|
filters = append(filters, f...)
|
||||||
} else {
|
} else {
|
||||||
log.Printf(`[%+v] is not a valid entry-type, ignored.
|
log.Printf(`[%+v] is not a valid entry-type, ignored.
|
||||||
Please set entry-type to one or more of the following:
|
Please set entry-type to one or more of the following:
|
||||||
ConfigChange, Normal, Request, InternalRaftRequest,
|
ConfigChange, Normal, Request, InternalRaftRequest,
|
||||||
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
|
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
|
||||||
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke`, et)
|
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke`, et)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user