Skip to content

Commit

Permalink
Address some minor logging issues
Browse files Browse the repository at this point in the history
Signed-off-by: Arrobo, Gabriel <[email protected]>
  • Loading branch information
gab-arrobo committed Nov 19, 2024
1 parent 3aafa5d commit 0a1a877
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions pfcp/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func HandlePfcpSendError(msg message.Message, pfcpErr error) {
msgType := msg.MessageType()
logger.PfcpLog.Errorf("send of PFCP msg [%v] failed with error [%v] ",
logger.PfcpLog.Errorf("send of PFCP msg [%v] failed with error [%v]",
msgType, pfcpErr.Error())
switch msgType {
case message.MsgTypeAssociationSetupRequest:
Expand All @@ -35,7 +35,7 @@ func HandlePfcpSendError(msg message.Message, pfcpErr error) {
}

func handleSendPfcpAssoSetReqError(msg message.Message, pfcpErr error) {
logger.PfcpLog.Debugf("send association setup request error [%v] ", pfcpErr.Error())
logger.PfcpLog.Debugf("send association setup request error [%v]", pfcpErr.Error())
// send Error
sendErrRsp(msg, pfcpErr)
}
Expand All @@ -47,7 +47,7 @@ func handleSendPfcpHeartbeatReqError(msg message.Message, pfcpErr error) {
}

func handleSendPfcpSessEstReqError(msg message.Message, pfcpErr error) {
logger.PfcpLog.Debugf("send session establishment request error [%v] ", pfcpErr.Error())
logger.PfcpLog.Debugf("send session establishment request error [%v]", pfcpErr.Error())
// send Error
sendErrRsp(msg, pfcpErr)
}
Expand Down Expand Up @@ -101,7 +101,7 @@ func HandlePfcpAssociationSetupResponse(msg message.Message) {
return
}

logger.PfcpLog.Debugf("HandlePfcpAssociationSetupResponse, recovery timestamp [%v] ", recoveryTimeStamp)
logger.PfcpLog.Debugf("handle pfcp association setup response, recovery timestamp [%v]", recoveryTimeStamp)

cause, err := rsp.Cause.Cause()
if err != nil {
Expand All @@ -117,7 +117,7 @@ func HandlePfcpAssociationSetupResponse(msg message.Message) {
return
}
// Add UPF as active
logger.PfcpLog.Debugf("node id from pfcp association response [%v] ", nodeIDstr)
logger.PfcpLog.Debugf("node id from pfcp association response [%v]", nodeIDstr)
nodeId := types.NewNodeID(nodeIDstr)
upf := config.ActivateUpfNode(nodeId)

Expand All @@ -127,7 +127,7 @@ func HandlePfcpAssociationSetupResponse(msg message.Message) {

// Encode pfcp rsp to byte and send to http txn
if err := encodeAndSendRsp(msg); err != nil {
logger.PfcpLog.Errorf("handle pfcp association response error [%v] ", err)
logger.PfcpLog.Errorf("handle pfcp association response error [%v]", err)
}
}

Expand All @@ -142,10 +142,10 @@ func HandlePfcpHeartbeatResponse(msg message.Message) {
logger.PfcpLog.Errorf("failed to parse recovery timestamp: %v", err)
return
}
logger.PfcpLog.Debugf("pfcp heartbeat response recovery timestamp [%v] ", recoveryTimestamp)
logger.PfcpLog.Debugf("pfcp heartbeat response recovery timestamp [%v]", recoveryTimestamp)
// Encode pfcp rsp to byte and send to http txn
if err := encodeAndSendRsp(msg); err != nil {
logger.PfcpLog.Errorf("handle pfcp heartbeat response error [%v] ", err)
logger.PfcpLog.Errorf("handle pfcp heartbeat response error [%v]", err)
}
}

Expand All @@ -157,7 +157,7 @@ func HandlePfcpSessionEstablishmentResponse(msg message.Message) {
}
// Encode pfcp rsp to byte and send to http txn
if err := encodeAndSendRsp(msg); err != nil {
logger.PfcpLog.Errorf("handle pfcp session establishment response error [%v] ", err)
logger.PfcpLog.Errorf("handle pfcp session establishment response error [%v]", err)
}
}

Expand All @@ -169,7 +169,7 @@ func HandlePfcpSessionModificationResponse(msg message.Message) {
}
// Encode pfcp rsp to byte and send to http txn
if err := encodeAndSendRsp(msg); err != nil {
logger.PfcpLog.Errorf("handle pfcp session modify response error [%v] ", err)
logger.PfcpLog.Errorf("handle pfcp session modify response error [%v]", err)
}
}

Expand All @@ -181,7 +181,7 @@ func HandlePfcpSessionDeletionResponse(msg message.Message) {
}
// Encode pfcp rsp to byte and send to http txn
if err := encodeAndSendRsp(msg); err != nil {
logger.PfcpLog.Errorf("handle pfcp session delete response error [%v] ", err)
logger.PfcpLog.Errorf("handle pfcp session delete response error [%v]", err)
}
}

Expand All @@ -195,7 +195,7 @@ func BuildPfcpAssociationResponse(nodeId *types.NodeID, seqNo uint32) (*message.
}

logger.AppLog.Errorf("upf [%v] not found", string(nodeId.NodeIdValue))
return nil, fmt.Errorf("upf not found : %v", string(nodeId.NodeIdValue))
return nil, fmt.Errorf("upf not found: %v", string(nodeId.NodeIdValue))
}

func BuildPfcpHeartBeatResponse(nodeId *types.NodeID, seqNo uint32) (*message.HeartbeatResponse, error) {
Expand All @@ -207,5 +207,5 @@ func BuildPfcpHeartBeatResponse(nodeId *types.NodeID, seqNo uint32) (*message.He
return &pfcpMsg, nil
}

return nil, fmt.Errorf("upf not found : %v", string(nodeId.NodeIdValue))
return nil, fmt.Errorf("upf not found: %v", string(nodeId.NodeIdValue))
}
2 changes: 1 addition & 1 deletion pfcp/message/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ProbeUpfHearbeatReq() {
if config.IsUpfAssociated(upf.NodeID) {
pfcpMsg, err := config.BuildPfcpHeartbeatRequest()
if err != nil {
logger.PfcpLog.Errorf("Failed to build heartbeat request for upf [%v]", nodeId)
logger.PfcpLog.Errorf("failed to build heartbeat request for upf [%v]", nodeId)
continue
}
err1 := SendHeartbeatRequest(upf.NodeID, pfcpMsg)
Expand Down

0 comments on commit 0a1a877

Please sign in to comment.