Skip to content

Commit

Permalink
Reduce MSP logging in peer CLI
Browse files Browse the repository at this point in the history
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 <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Feb 9, 2017
1 parent cf3d75a commit 312fd1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions msp/configbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func readPemFile(file string) ([]byte, error) {
}

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

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

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

item, err := readPemFile(fullName)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion msp/identities.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type identity struct {
}

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

Expand Down
6 changes: 3 additions & 3 deletions msp/mspimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type bccspmsp struct {
// generate identities and signing identities backed by
// certificates and keypairs
func NewBccspMsp() (MSP, error) {
mspLogger.Infof("Creating BCCSP-based MSP instance")
mspLogger.Debugf("Creating BCCSP-based MSP instance")

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

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

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

if msp.signer == nil {
return nil, fmt.Errorf("This MSP does not possess a valid default signing identity")
Expand Down
6 changes: 3 additions & 3 deletions msp/mspmgrimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (mgr *mspManagerImpl) Setup(msps []*msp.MSPConfig) error {
return fmt.Errorf("Setup error: at least one MSP configuration item is required")
}

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

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

mspLogger.Infof("Setting up MSP")
mspLogger.Debugf("Setting up MSP")

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

mgr.up = true

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

return nil
}
Expand Down

0 comments on commit 312fd1d

Please sign in to comment.