X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fteststub%2Ftestwrapper.go;h=d75dea3e8e171f797c739fb9bc7db419e0cd1a47;hb=fc67b036d8944c372715b7306f892d2ddfb4684f;hp=f27392dbeda6909acf242e1dda976dd06db58537;hpb=5f8ffa07163f52d65092d63f5d173149cd5c46ad;p=ric-plt%2Fsubmgr.git diff --git a/pkg/teststub/testwrapper.go b/pkg/teststub/testwrapper.go index f27392d..d75dea3 100644 --- a/pkg/teststub/testwrapper.go +++ b/pkg/teststub/testwrapper.go @@ -20,23 +20,31 @@ package teststub import ( "fmt" - "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" + "strings" "testing" ) type TestWrapper struct { - xapptweaks.LogWrapper + *xapp.Log + desc string } func (tw *TestWrapper) Init(desc string) { - tw.LogWrapper.Init(desc) + tw.desc = strings.ToUpper(desc) + tw.Log = xapp.NewLogger(tw.desc) + //tw.SetLevel(defaultLogLevel) +} + +func (tw *TestWrapper) GetDesc() string { + return tw.desc } //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- func (tw *TestWrapper) TestError(t *testing.T, pattern string, args ...interface{}) { - tw.Logger.Error(fmt.Sprintf(pattern, args...)) + tw.Error(fmt.Sprintf(pattern, args...)) t.Errorf(fmt.Sprintf(pattern, args...)) } @@ -44,7 +52,7 @@ func (tw *TestWrapper) TestError(t *testing.T, pattern string, args ...interface // //----------------------------------------------------------------------------- func (tw *TestWrapper) TestLog(t *testing.T, pattern string, args ...interface{}) { - tw.Logger.Info(fmt.Sprintf(pattern, args...)) + tw.Debug(fmt.Sprintf(pattern, args...)) t.Logf(fmt.Sprintf(pattern, args...)) }