Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address some minor logging issues #13

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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