Skip to content

Commit

Permalink
fixed log format
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Gahlot <[email protected]>
  • Loading branch information
gauravgahlot committed Aug 20, 2020
1 parent adb49da commit cde2736
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions grpc-server/tinkerbell.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grpcserver

import (
"context"
"fmt"
"time"

"github.com/tinkerbell/tink/db"
Expand Down Expand Up @@ -90,7 +91,7 @@ func (s *server) ReportActionStatus(context context.Context, req *pb.WorkflowAct
return nil, status.Errorf(codes.InvalidArgument, errInvalidActionName)
}

logger.Info(msgReceivedStatus, req.GetActionStatus())
logger.Info(fmt.Sprintf(msgReceivedStatus, req.GetActionStatus()))

wfContext, err := s.db.GetWorkflowContexts(context, wfID)
if err != nil {
Expand Down Expand Up @@ -130,7 +131,7 @@ func (s *server) ReportActionStatus(context context.Context, req *pb.WorkflowAct
if err != nil {
return &pb.Empty{}, status.Error(codes.Aborted, err.Error())
}
logger.Info(msgCurrentWfContext, wfContext)
logger.Info(fmt.Sprintf(msgCurrentWfContext, wfContext))
return &pb.Empty{}, nil
}

Expand Down Expand Up @@ -218,12 +219,12 @@ func isApplicableToSend(context context.Context, wfContext *pb.WorkflowContext,
}
if wfContext.GetCurrentActionIndex() == 0 {
if actions.ActionList[wfContext.GetCurrentActionIndex()+1].GetWorkerId() == workerID {
logger.Info(msgSendWfContext, wfContext.GetWorkflowId())
logger.Info(fmt.Sprintf(msgSendWfContext, wfContext.GetWorkflowId()))
return true
}
}
} else if actions.ActionList[wfContext.GetCurrentActionIndex()].GetWorkerId() == workerID {
logger.Info(msgSendWfContext, wfContext.GetWorkflowId())
logger.Info(fmt.Sprintf(msgSendWfContext, wfContext.GetWorkflowId()))
return true

}
Expand Down

0 comments on commit cde2736

Please sign in to comment.