API update 54/5154/2 v0.6.7
authorMohamed Abukar <abukar.mohamed@nokia.com>
Wed, 25 Nov 2020 11:51:00 +0000 (13:51 +0200)
committerMohamed Abukar <abukar.mohamed@nokia.com>
Wed, 25 Nov 2020 11:51:47 +0000 (13:51 +0200)
Change-Id: Iefb91e5d5690d2950e3203099b40ab370e1680a2
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
pkg/xapp/config.go
pkg/xapp/logger.go
pkg/xapp/xapp_test.go

index 2260153..11daf4f 100755 (executable)
@@ -209,3 +209,7 @@ func (*Configurator) GetStringSlice(key string) []string {
 func (*Configurator) GetStringMap(key string) map[string]interface{} {
        return viper.GetStringMap(key)
 }
+
+func (*Configurator) IsSet(key string) bool {
+       return viper.IsSet(key)
+}
index 69bed09..226a909 100755 (executable)
@@ -48,6 +48,10 @@ func (l *Log) SetMdc(key string, value string) {
        l.logger.MdcAdd(key, value)
 }
 
+func (l *Log) GetLevel() mdclog.Level {
+       return l.logger.LevelGet()
+}
+
 func (l *Log) Error(pattern string, args ...interface{}) {
        if l.logger.LevelGet() < mdclog.ERR {
                return
index 4361491..04bbbb8 100755 (executable)
@@ -340,6 +340,7 @@ func TestConfigAccess(t *testing.T) {
        Config.Get("controls")
        Config.GetStringSlice("messaging.ports")
        Config.GetStringMap("messaging.ports")
+       Config.IsSet("messaging")
 }
 
 func TestPublishConfigChange(t *testing.T) {
@@ -412,6 +413,7 @@ func TestRnibInterfaces(t *testing.T) {
 func TestLogger(t *testing.T) {
        Logger.Error("CASE: TestNewSubscriber")
        Logger.Warn("CASE: TestNewSubscriber")
+       Logger.GetLevel()
 }
 
 func TestConfigHandler(t *testing.T) {