tools/etcd-dump-logs/main.go
func evaluateEntrytypeFlag(entrytype string) []EntryFilter {
	var entrytypelist []string
	if entrytype != "" {
		entrytypelist = strings.Split(entrytype, ",")
	}

	validRequest := map[string][]EntryFilter{"ConfigChange": {passConfChange},
		"Normal":              {passInternalRaftRequest, passRequest, passUnknownNormal},
		"Request":             {passRequest},
		"InternalRaftRequest": {passInternalRaftRequest},
		"IRRRange":            {passIRRRange},
		"IRRPut":              {passIRRPut},
		"IRRDeleteRange":      {passIRRDeleteRange},
		"IRRTxn":              {passIRRTxn},
		"IRRCompaction":       {passIRRCompaction},
		"IRRLeaseGrant":       {passIRRLeaseGrant},
		"IRRLeaseRevoke":      {passIRRLeaseRevoke},
		"IRRLeaseCheckpoint":  {passIRRLeaseCheckpoint},
	}
	filters := make([]EntryFilter, 0)
	if len(entrytypelist) == 0 {
		filters = append(filters, passInternalRaftRequest)
		filters = append(filters, passRequest)
		filters = append(filters, passUnknownNormal)
		filters = append(filters, passConfChange)
	}
	for _, et := range entrytypelist {
		if f, ok := validRequest[et]; ok {
			filters = append(filters, f...)
		} else {
			log.Printf(`[%+v] is not a valid entry-type, ignored.
Please set entry-type to one or more of the following:
ConfigChange, Normal, Request, InternalRaftRequest,
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint`, et)
		}
	}

	return filters
}
func evaluateEntrytypeFlag(entrytype string) []EntryFilter {
	var entrytypelist []string
	if entrytype != "" {
		entrytypelist = strings.Split(entrytype, ",")
	}

	validRequest := map[string][]EntryFilter{"ConfigChange": {passConfChange},
		"Normal":              {passInternalRaftRequest, passRequest, passUnknownNormal},
		"Request":             {passRequest},
		"InternalRaftRequest": {passInternalRaftRequest},
		"IRRRange":            {passIRRRange},
		"IRRPut":              {passIRRPut},
		"IRRDeleteRange":      {passIRRDeleteRange},
		"IRRTxn":              {passIRRTxn},
		"IRRCompaction":       {passIRRCompaction},
		"IRRLeaseGrant":       {passIRRLeaseGrant},
		"IRRLeaseRevoke":      {passIRRLeaseRevoke},
		"IRRLeaseCheckpoint":  {passIRRLeaseCheckpoint},
	}
	filters := make([]EntryFilter, 0)
	if len(entrytypelist) == 0 {
		filters = append(filters, passInternalRaftRequest)
		filters = append(filters, passRequest)
		filters = append(filters, passUnknownNormal)
		filters = append(filters, passConfChange)
	}
	for _, et := range entrytypelist {
		if f, ok := validRequest[et]; ok {
			filters = append(filters, f...)
		} else {
			log.Printf(`[%+v] is not a valid entry-type, ignored.
Please set entry-type to one or more of the following:
ConfigChange, Normal, Request, InternalRaftRequest,
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint`, et)
		}
	}

	return filters
}
func evaluateEntrytypeFlag ( entrytype string ) [ ] EntryFilter { var entrytypelist [ ] string if entrytype != " " { entrytypelist = strings . Split ( entrytype , " " ) } validRequest := map [ string ] [ ] EntryFilter { " " : { passConfChange } , " " : { passInternalRaftRequest , passRequest , passUnknownNormal } , " " : { passRequest } , " " : { passInternalRaftRequest } , " " : { passIRRRange } , " " : { passIRRPut } , " " : { passIRRDeleteRange } , " " : { passIRRTxn } , " " : { passIRRCompaction } , " " : { passIRRLeaseGrant } , " " : { passIRRLeaseRevoke } , " " : { passIRRLeaseCheckpoint } , } filters := make ( [ ] EntryFilter , 0 ) if len ( entrytypelist ) == 0 { filters = append ( filters , passInternalRaftRequest ) filters = append ( filters , passRequest ) filters = append ( filters , passUnknownNormal ) filters = append ( filters , passConfChange ) } for _ , et := range entrytypelist { if f , ok := validRequest [ et ] ; ok { filters = append ( filters , f ... ) } else { log . Printf ( `[%+v] is not a valid entry-type, ignored.
Please set entry-type to one or more of the following:
ConfigChange, Normal, Request, InternalRaftRequest,
IRRRange, IRRPut, IRRDeleteRange, IRRTxn,
IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint` , et ) } } return filters }
// evaluateEntrytypeFlag evaluates entry-type flag and choose proper filter/filters to filter entries
evaluateEntrytypeFlag evaluates entry - type flag and choose proper filter / filters to filter entries