From 6f0120fde0b44d17ba9d5225e1ceba39761bf6a6 Mon Sep 17 00:00:00 2001 From: Ajay Lotan Thakur Date: Sat, 1 Jun 2024 06:44:29 -0400 Subject: [PATCH] Update Module name in the go.mod & log cleanup (#77) --- go.mod | 2 +- simapp.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index eb14db3..9b64511 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module simapp +module github.com/omec-project/simapp go 1.21 diff --git a/simapp.go b/simapp.go index 5804cc0..f46e0f0 100644 --- a/simapp.go +++ b/simapp.go @@ -416,7 +416,7 @@ func sendMessage(msgChan chan configMessage, subProvisionEndpt SubProvisionEndpt log.Printf("Post Message [%v] to %v", msg.String(), httpend) req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, httpend, msg.msgPtr) if err != nil { - fmt.Printf("An Error Occurred %v", err) + log.Printf("An Error Occurred %v", err) time.Sleep(1 * time.Second) continue } @@ -430,14 +430,14 @@ func sendMessage(msgChan chan configMessage, subProvisionEndpt SubProvisionEndpt log.Printf("Post Message [%v] returned error [%v] ", httpend, httpErr.Error()) } - fmt.Printf("Message POST %v Success\n", rsp.StatusCode) + log.Printf("Message POST %v Success\n", rsp.StatusCode) } else if msg.msgOp == modify_op { log.Printf("Put Message [%v] to %v", msg.String(), httpend) req, err := http.NewRequestWithContext(context.Background(), http.MethodPut, httpend, msg.msgPtr) // Handle Error if err != nil { - fmt.Printf("An Error Occurred %v", err) + log.Printf("An Error Occurred %v", err) time.Sleep(1 * time.Second) continue } @@ -451,14 +451,14 @@ func sendMessage(msgChan chan configMessage, subProvisionEndpt SubProvisionEndpt log.Printf("Put Message [%v] returned error [%v] ", httpend, httpErr.Error()) } - fmt.Printf("Message PUT %v Success\n", rsp.StatusCode) + log.Printf("Message PUT %v Success\n", rsp.StatusCode) } else if msg.msgOp == delete_op { log.Printf("Delete Message [%v] to %v", msg.String(), httpend) req, err := http.NewRequestWithContext(context.Background(), http.MethodDelete, httpend, msg.msgPtr) // Handle Error if err != nil { - fmt.Printf("An Error Occurred %v", err) + log.Printf("An Error Occurred %v", err) time.Sleep(1 * time.Second) continue } @@ -471,7 +471,7 @@ func sendMessage(msgChan chan configMessage, subProvisionEndpt SubProvisionEndpt if httpErr != nil { log.Printf("Delete Message [%v] returned error [%v] ", httpend, httpErr.Error()) } - fmt.Printf("Message DEL %v Success\n", rsp.StatusCode) + log.Printf("Message DEL %v Success\n", rsp.StatusCode) } err := rsp.Body.Close() if err != nil { @@ -954,13 +954,13 @@ func dispatchAllGroups(configMsgChan chan configMessage) { func dispatchNetworkSlice(configMsgChan chan configMessage, slice *NetworkSlice, msgOp int) { log.Println(" Slice Name : ", slice.Name) - fmt.Printf(" Slice sst %v, sd %v", slice.SliceId.Sst, slice.SliceId.Sd) + log.Printf(" Slice sst %v, sd %v", slice.SliceId.Sst, slice.SliceId.Sd) log.Println(" Slice site info ", slice.SiteInfo) site := slice.SiteInfo log.Println(" Slice site name ", site.SiteName) log.Println(" Slice gNB ", len(site.Gnb)) for e := 0; e < len(site.Gnb); e++ { - fmt.Printf(" Slice gNB[%v] = %v \n", e, site.Gnb[e]) + log.Printf(" Slice gNB[%v] = %v \n", e, site.Gnb[e]) } log.Println(" Slice Plmn ", site.Plmn) log.Println(" Slice Upf ", site.Upf)