From b52b676d29aaf1aa46eb8213be4fd8cae53f0f41 Mon Sep 17 00:00:00 2001 From: Will Lahti Date: Fri, 24 Feb 2017 10:53:13 -0500 Subject: [PATCH] Update log level for some BCCSP keystore messages This change updates two BCCSP keystore log messages to use Debugf instead of Infof and moves them inside the if statement to only log when the keystore doesn't exist. https://jira.hyperledger.org/browse/FAB-1870 Change-Id: I0bf6a6da8d7ba0a76a44e80c90ac53799eb6e65c Signed-off-by: Will Lahti --- bccsp/pkcs11/fileks.go | 3 ++- bccsp/sw/fileks.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bccsp/pkcs11/fileks.go b/bccsp/pkcs11/fileks.go index 8a1af88d51f..d0ecf1ecf93 100644 --- a/bccsp/pkcs11/fileks.go +++ b/bccsp/pkcs11/fileks.go @@ -329,9 +329,10 @@ func (ks *FileBasedKeyStore) createKeyStoreIfNotExists() error { // Check keystore directory ksPath := ks.path missing, err := utils.DirMissingOrEmpty(ksPath) - logger.Infof("KeyStore path [%s] missing [%t]: [%s]", ksPath, missing, utils.ErrToString(err)) if missing { + logger.Debugf("KeyStore path [%s] missing [%t]: [%s]", ksPath, missing, utils.ErrToString(err)) + err := ks.createKeyStore() if err != nil { logger.Errorf("Failed creating KeyStore At [%s]: [%s]", ksPath, err.Error()) diff --git a/bccsp/sw/fileks.go b/bccsp/sw/fileks.go index f1bd2ca3573..801ade9e12d 100644 --- a/bccsp/sw/fileks.go +++ b/bccsp/sw/fileks.go @@ -361,9 +361,10 @@ func (ks *fileBasedKeyStore) createKeyStoreIfNotExists() error { // Check keystore directory ksPath := ks.path missing, err := utils.DirMissingOrEmpty(ksPath) - logger.Infof("KeyStore path [%s] missing [%t]: [%s]", ksPath, missing, utils.ErrToString(err)) if missing { + logger.Debugf("KeyStore path [%s] missing [%t]: [%s]", ksPath, missing, utils.ErrToString(err)) + err := ks.createKeyStore() if err != nil { logger.Errorf("Failed creating KeyStore At [%s]: [%s]", ksPath, err.Error())