X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fhttpgetter.go;h=fca48f4055645f886a23ba563bb811a1a6e3a864;hb=a8596ec6db91b8a45a1a21421a726b9b05ce7d48;hp=0bf05bca3ce1ebebca8a2d1046a3c2c48f5d7093;hpb=89c2cdeff5dc079ab1aca01e2e830a961095198f;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/httpgetter.go b/pkg/nbi/httpgetter.go index 0bf05bc..fca48f4 100644 --- a/pkg/nbi/httpgetter.go +++ b/pkg/nbi/httpgetter.go @@ -32,6 +32,7 @@ package nbi import ( "encoding/json" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" "net/http" "routing-manager/pkg/rpe" "routing-manager/pkg/rtmgr" @@ -53,7 +54,7 @@ func NewHttpGetter() *HttpGetter { var myClient = &http.Client{Timeout: 5 * time.Second} func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) { - rtmgr.Logger.Info("Invoked httpGetter.fetchXappList: " + xmurl) + xapp.Logger.Info("Invoked httpGetter.fetchXappList: " + xmurl) r, err := myClient.Get(xmurl) if err != nil { return nil, err @@ -61,17 +62,17 @@ func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) { defer r.Body.Close() if r.StatusCode == 200 { - rtmgr.Logger.Debug("http client raw response: %v", r) + xapp.Logger.Debug("http client raw response: %v", r) var xApps []rtmgr.XApp err = json.NewDecoder(r.Body).Decode(&xApps) if err != nil { - rtmgr.Logger.Warn("Json decode failed: " + err.Error()) + xapp.Logger.Warn("Json decode failed: " + err.Error()) } - rtmgr.Logger.Info("HTTP GET: OK") - rtmgr.Logger.Debug("httpGetter.fetchXappList returns: %v", xApps) + xapp.Logger.Info("HTTP GET: OK") + xapp.Logger.Debug("httpGetter.fetchXappList returns: %v", xApps) return &xApps, err } - rtmgr.Logger.Warn("httpGetter got an unexpected http status code: %v", r.StatusCode) + xapp.Logger.Warn("httpGetter got an unexpected http status code: %v", r.StatusCode) return nil, nil }