From 5dfa0c9f2f41420576893b7e43bf1dd2186528a4 Mon Sep 17 00:00:00 2001 From: khorevaa Date: Mon, 1 Feb 2021 19:23:08 +0300 Subject: [PATCH] fix: error in tests --- example_test.go | 2 -- logos_test.go | 46 ++++++---------------------------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/example_test.go b/example_test.go index 300daf9..dcb388b 100644 --- a/example_test.go +++ b/example_test.go @@ -67,8 +67,6 @@ loggerConfigs: log := logos.New("") // like github.com/khorevaa/logos log.Info("This is me first log. Hello world logging systems") - // Output: - // .+"logger":"","msg":"This is me first log. Hello world logging systems"} } func ExampleNew_with_color_scheme() { diff --git a/logos_test.go b/logos_test.go index 9822589..068159b 100644 --- a/logos_test.go +++ b/logos_test.go @@ -6,46 +6,12 @@ import ( "testing" ) -func TestNew(t *testing.T) { - - tests := []struct { - name string - logName string - text []string - }{ - { - "simple", - "github.com/khorevaa/logos", - []string{"hello world", "hello"}, - }, - { - "simple", - "github.com/v8platform", - []string{"hello world", "hello"}, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - log := New(tt.logName) - - SetLevel(tt.logName, zap.DebugLevel) - - for _, text := range tt.text { - //stdlog.Println(text) - log.Info(text) - log.Debug(text) - } - }) - } -} - func TestInitWithConfigContent(t *testing.T) { const newConfig = ` appenders: console: - name: CONSOLE - target: stdout + target: discard #no_color: true encoder: console: @@ -75,6 +41,11 @@ loggerConfigs: level: debug ` + err := InitWithConfigContent(newConfig) + + //l.SetLLevel(OffLevel) + assert.Nil(t, err) + l := New("github.com/logger") l.Info("hello") l.Debug("world") @@ -82,11 +53,6 @@ loggerConfigs: l2.Info("hello world test/logger/v1", zap.String("key", "val")) l2.Debug("hello world test/logger/v1") - err := InitWithConfigContent(newConfig) - - //l.SetLLevel(OffLevel) - assert.Nil(t, err) - //err = InitWithConfigContent(newConfig) //assert.NotNil(t, err)