Skip to content

Commit

Permalink
[FAB-1870] Logging cleanup for peer start
Browse files Browse the repository at this point in the history
This CR updates all fmt.Print calls in peer/node/start.go to use the
logger instead.

Change-Id: Ib8709267f33711215cb35e66f4e7352f2c523c10
Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
  • Loading branch information
wlahti committed Apr 25, 2017
1 parent c5c60c3 commit cefe57a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ func serve(args []string) error {

//this creates testchainid and sets up gossip
if err = peer.CreateChainFromBlock(block); err == nil {
fmt.Printf("create chain [%s]", chainID)
logger.Infof("create chain [%s]", chainID)
scc.DeploySysCCs(chainID)
logger.Infof("Deployed system chaincodes on %s", chainID)
} else {
fmt.Printf("create default chain [%s] failed with %s", chainID, err)
logger.Errorf("create default chain [%s] failed with %s", chainID, err)
}
}

Expand All @@ -226,8 +226,7 @@ func serve(args []string) error {
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
go func() {
sig := <-sigs
fmt.Println()
fmt.Println(sig)
logger.Debugf("sig: %s", sig)
serve <- nil
}()

Expand Down Expand Up @@ -290,7 +289,7 @@ func registerChaincodeSupport(grpcServer *grpc.Server) {
//get chaincode startup timeout
tOut, err := strconv.Atoi(viper.GetString("chaincode.startuptimeout"))
if err != nil { //what went wrong ?
fmt.Printf("could not retrive timeout var...setting to 5secs\n")
logger.Warning("could not retrieve timeout var...setting to 5secs")
tOut = 5000
}
ccStartupTimeout := time.Duration(tOut) * time.Millisecond
Expand All @@ -313,7 +312,7 @@ func createEventHubServer(secureConfig comm.SecureServerConfig) (comm.GRPCServer

grpcServer, err := comm.NewGRPCServerFromListener(lis, secureConfig)
if err != nil {
fmt.Println("Failed to return new GRPC server: ", err)
logger.Errorf("Failed to return new GRPC server: %s", err)
return nil, err
}
ehServer := producer.NewEventsServer(
Expand Down

0 comments on commit cefe57a

Please sign in to comment.