Further enhancements
[ric-plt/xapp-frame.git] / pkg / xapp / xapp.go
index de355fb..f778265 100755 (executable)
@@ -91,13 +91,13 @@ func registerXapp() {
        for {
                time.Sleep(5 * time.Second)
                if !IsHealthProbeReady() {
-                       Logger.Info("xApp is not ready yet, waiting ...")
+                       Logger.Info("Application='%s' is not ready yet, waiting ...", viper.GetString("name"))
                        continue
                }
 
-               Logger.Info("xApp is now up and ready, continue with registration ...")
+               Logger.Debug("Application='%s' is now up and ready, continue with registration ...", viper.GetString("name"))
                if err := doRegister(); err == nil {
-                       Logger.Info("xApp registration done, proceeding with startup ...")
+                       Logger.Info("Registration done, proceeding with startup ...")
                        break
                }
        }
@@ -243,12 +243,15 @@ func init() {
        } else {
                Logger.SetLevel(viper.GetInt("logger.level"))
        }
-       Logger.SetFormat(0)
+
+       if !viper.IsSet("controls.logger.noFormat") || !viper.GetBool("controls.logger.noFormat") {
+               Logger.SetFormat(0)
+       }
 
        Resource = NewRouter()
        Config = Configurator{}
        Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router)
-       Subscription = NewSubscriber(viper.GetString("subscription.host"), viper.GetInt("subscription.timeout"))
+       Subscription = NewSubscriber(viper.GetString("controls.subscription.host"), viper.GetInt("controls.subscription.timeout"))
        Sdl = NewSDLClient(viper.GetString("controls.db.namespace"))
        Rnib = NewRNIBClient()
        Util = NewUtils()