github.com/koko1123/flow-go-1@v0.29.6/utils/logging/identifier.go (about) 1 // (c) 2019 Dapper Labs - ALL RIGHTS RESERVED 2 3 package logging 4 5 import ( 6 "encoding/hex" 7 "fmt" 8 9 "github.com/koko1123/flow-go-1/model/flow" 10 ) 11 12 func Entity(entity flow.Entity) []byte { 13 id := entity.ID() 14 return id[:] 15 } 16 17 func ID(id flow.Identifier) []byte { 18 return id[:] 19 } 20 21 func Type(obj interface{}) string { 22 return fmt.Sprintf("%T", obj) 23 } 24 25 func IDs(ids []flow.Identifier) []string { 26 ss := make([]string, 0, len(ids)) 27 for _, id := range ids { 28 ss = append(ss, hex.EncodeToString(id[:])) 29 } 30 return ss 31 }