Skip to content

Commit 312fd1d

Browse files
committed
Reduce MSP logging in peer CLI
When invoking CLI command the MSP is initialized and logs stuff to the output, which might be confusing and overly verbose. This commit simply adjusts the log invocations to be Debug(f) instead of Info(f). Change-Id: Id59af04c5733a5314d8b3df068f7fbf51af72251 Signed-off-by: Yacov Manevich <[email protected]>
1 parent cf3d75a commit 312fd1d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

msp/configbuilder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func readPemFile(file string) ([]byte, error) {
3636
}
3737

3838
func getPemMaterialFromDir(dir string) ([][]byte, error) {
39-
mspLogger.Infof("Reading directory %s", dir)
39+
mspLogger.Debugf("Reading directory %s", dir)
4040

4141
content := make([][]byte, 0)
4242
files, err := ioutil.ReadDir(dir)
@@ -50,7 +50,7 @@ func getPemMaterialFromDir(dir string) ([][]byte, error) {
5050
}
5151

5252
fullName := filepath.Join(dir, string(filepath.Separator), f.Name())
53-
mspLogger.Infof("Inspecting file %s", fullName)
53+
mspLogger.Debugf("Inspecting file %s", fullName)
5454

5555
item, err := readPemFile(fullName)
5656
if err != nil {

msp/identities.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type identity struct {
4646
}
4747

4848
func newIdentity(id *IdentityIdentifier, cert *x509.Certificate, pk bccsp.Key, msp *bccspmsp) Identity {
49-
mspLogger.Infof("Creating identity instance for ID %s", id)
49+
mspLogger.Debugf("Creating identity instance for ID %s", id)
5050
return &identity{id: id, cert: cert, pk: pk, msp: msp}
5151
}
5252

msp/mspimpl.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type bccspmsp struct {
5858
// generate identities and signing identities backed by
5959
// certificates and keypairs
6060
func NewBccspMsp() (MSP, error) {
61-
mspLogger.Infof("Creating BCCSP-based MSP instance")
61+
mspLogger.Debugf("Creating BCCSP-based MSP instance")
6262

6363
// TODO: security level, hash family and keystore should
6464
// be probably set in the appropriate way.
@@ -151,7 +151,7 @@ func (msp *bccspmsp) Setup(conf1 *m.MSPConfig) error {
151151

152152
// set the name for this msp
153153
msp.name = conf.Name
154-
mspLogger.Infof("Setting up MSP instance %s", msp.name)
154+
mspLogger.Debugf("Setting up MSP instance %s", msp.name)
155155

156156
// make and fill the set of admin certs
157157
msp.admins = make([]Identity, len(conf.Admins))
@@ -201,7 +201,7 @@ func (msp *bccspmsp) GetIdentifier() (string, error) {
201201
// GetDefaultSigningIdentity returns the
202202
// default signing identity for this MSP (if any)
203203
func (msp *bccspmsp) GetDefaultSigningIdentity() (SigningIdentity, error) {
204-
mspLogger.Infof("Obtaining default signing identity")
204+
mspLogger.Debugf("Obtaining default signing identity")
205205

206206
if msp.signer == nil {
207207
return nil, fmt.Errorf("This MSP does not possess a valid default signing identity")

msp/mspmgrimpl.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (mgr *mspManagerImpl) Setup(msps []*msp.MSPConfig) error {
5656
return fmt.Errorf("Setup error: at least one MSP configuration item is required")
5757
}
5858

59-
mspLogger.Infof("Setting up the MSP manager (%d msps)", len(msps))
59+
mspLogger.Debugf("Setting up the MSP manager (%d msps)", len(msps))
6060

6161
// create the map that assigns MSP IDs to their manager instance - once
6262
mgr.mspsMap = make(map[string]MSP)
@@ -67,7 +67,7 @@ func (mgr *mspManagerImpl) Setup(msps []*msp.MSPConfig) error {
6767
return fmt.Errorf("Setup error: unsupported msp type %d", mspConf.Type)
6868
}
6969

70-
mspLogger.Infof("Setting up MSP")
70+
mspLogger.Debugf("Setting up MSP")
7171

7272
// create the msp instance
7373
msp, err := NewBccspMsp()
@@ -91,7 +91,7 @@ func (mgr *mspManagerImpl) Setup(msps []*msp.MSPConfig) error {
9191

9292
mgr.up = true
9393

94-
mspLogger.Infof("MSP manager setup complete, setup %d msps", len(msps))
94+
mspLogger.Debugf("MSP manager setup complete, setup %d msps", len(msps))
9595

9696
return nil
9797
}

0 commit comments

Comments
 (0)