github.com/hyperledger/aries-framework-go@v0.3.2/pkg/internal/logutil/util.go (about) 1 /* 2 Copyright SecureKey Technologies Inc. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package logutil 8 9 import ( 10 "fmt" 11 12 "github.com/hyperledger/aries-framework-go/pkg/common/log" 13 ) 14 15 // LogError is a utility function to log error messages. 16 func LogError(logger *log.Log, command, action, errMsg string, data ...string) { 17 logger.Errorf("command=[%s] action=[%s] %s errMsg=[%s]", command, action, data, errMsg) 18 } 19 20 // LogDebug is a utility function to log debug messages. 21 func LogDebug(logger *log.Log, command, action, msg string, data ...string) { 22 logger.Debugf("command=[%s] action=[%s] %s msg=[%s]", command, action, data, msg) 23 } 24 25 // LogInfo is a utility function to log info messages. 26 func LogInfo(logger *log.Log, command, action, msg string, data ...string) { 27 logger.Infof("command=[%s] action=[%s] %s msg=[%s]", command, action, data, msg) 28 } 29 30 // CreateKeyValueString creates a concatenated string. 31 func CreateKeyValueString(key, val string) string { 32 return fmt.Sprintf("%s=[%s]", key, val) 33 }