ASN.1 debug printouts hided by default
[ric-plt/submgr.git] / pkg / control / control.go
index 87c81ff..08000b0 100755 (executable)
@@ -150,7 +150,7 @@ func NewControl() *Control {
                e2SubsDb:          CreateSdl(),
                restSubsDb:        CreateRESTSdl(),
                Counters:          xapp.Metric.RegisterCounterGroup(GetMetricsOpts(), "SUBMGR"),
-               LoggerLevel:       4,
+               LoggerLevel:       1,
        }
 
        e2IfState.Init(c)
@@ -161,16 +161,13 @@ func NewControl() *Control {
        xapp.Resource.InjectRoute("/ric/v1/restsubscriptions", c.GetAllRestSubscriptions, "GET")
        xapp.Resource.InjectRoute("/ric/v1/symptomdata", c.SymptomDataHandler, "GET")
 
-       if readSubsFromDb == "false" {
-               return c
+       if readSubsFromDb == "true" {
+               // Read subscriptions from db
+               c.ReadE2Subscriptions()
+               c.ReadRESTSubscriptions()
        }
 
-       // Read subscriptions from db
-       c.ReadE2Subscriptions()
-       c.ReadRESTSubscriptions()
-
        go xapp.Subscription.Listen(c.RESTSubscriptionHandler, c.RESTQueryHandler, c.RESTSubscriptionDeleteHandler)
-
        return c
 }
 
@@ -242,6 +239,7 @@ func (c *Control) ReadConfigParameters(f string) {
 
        c.LoggerLevel = int(xapp.Logger.GetLevel())
        xapp.Logger.Debug("LoggerLevel= %v", c.LoggerLevel)
+       c.e2ap.SetASN1DebugPrintStatus(c.LoggerLevel)
 
        // viper.GetDuration returns nanoseconds
        e2tSubReqTimeout = viper.GetDuration("controls.e2tSubReqTimeout_ms") * 1000000
@@ -1112,7 +1110,6 @@ func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *Tran
                        removeSubscriptionFromDb = true
                        subRfMsg, valid = subs.SetCachedResponse(event, false)
                        xapp.Logger.Debug("SUBS-SubReq: internal delete due failure event(%s) %s", typeofSubsMessage(event), idstring(nil, trans, subs, parentTrans))
-                       c.sendE2TSubscriptionDeleteRequest(subs, trans, parentTrans)
                case *SubmgrRestartTestEvent:
                        // This simulates that no response has been received and after restart subscriptions are restored from db
                        xapp.Logger.Debug("Test restart flag is active. Dropping this transaction to test restart case")