github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/utils/logging/identifier.go (about)

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