We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73fb407 commit 0ae9972Copy full SHA for 0ae9972
setup_test.go
@@ -7,6 +7,9 @@ import (
7
"os"
8
"strings"
9
"testing"
10
+
11
+ "go.uber.org/zap"
12
+ "go.uber.org/zap/zapcore"
13
)
14
15
func TestGetLoggerDefault(t *testing.T) {
@@ -240,3 +243,18 @@ func TestCustomCore(t *testing.T) {
240
243
t.Errorf("got %q, wanted it to contain log output", buf2.String())
241
244
}
242
245
246
247
+func TestTeeCore(t *testing.T) {
248
+ // configure to use a tee logger
249
+ tee := zap.New(zapcore.NewTee(
250
+ zap.NewNop().Core(),
251
252
+ ), zap.AddCaller())
253
+ SetPrimaryCore(tee.Core())
254
+ log := getLogger("test")
255
+ log.Error("scooby")
256
257
+ // replaces the tee logger with a simple one
258
+ SetPrimaryCore(zap.NewNop().Core())
259
+ log.Error("doo")
260
+}
0 commit comments