MCPcopy
hub / github.com/uber-go/zap / TestLoggerDebugExpected

Function TestLoggerDebugExpected

zapgrpc/zapgrpc_test.go:68–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestLoggerDebugExpected(t *testing.T) {
69 checkMessages(t, zapcore.DebugLevel, []Option{WithDebug()}, zapcore.DebugLevel, []string{
70 "hello",
71 "s1s21 2 3s34s56",
72 "hello world",
73 "",
74 "foo",
75 "foo bar",
76 "s1 s2 1 2 3 s3 4 s5 6",
77 }, func(logger *Logger) {
78 logger.Print("hello")
79 logger.Print("s1", "s2", 1, 2, 3, "s3", 4, "s5", 6)
80 logger.Printf("%s world", "hello")
81 logger.Println()
82 logger.Println("foo")
83 logger.Println("foo", "bar")
84 logger.Println("s1", "s2", 1, 2, 3, "s3", 4, "s5", 6)
85 })
86}
87
88func TestLoggerDebugSuppressed(t *testing.T) {
89 checkMessages(t, zapcore.InfoLevel, []Option{WithDebug()}, zapcore.DebugLevel, nil, func(logger *Logger) {

Callers

nothing calls this directly

Calls 5

checkMessagesFunction · 0.85
WithDebugFunction · 0.85
PrintMethod · 0.45
PrintfMethod · 0.45
PrintlnMethod · 0.45

Tested by

no test coverage detected