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

Function TestLoggerErrorExpected

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

Source from the content-addressed store, hash-verified

116}
117
118func TestLoggerErrorExpected(t *testing.T) {
119 checkMessages(t, zapcore.DebugLevel, nil, zapcore.ErrorLevel, []string{
120 "hello",
121 "s1s21 2 3s34s56",
122 "hello world",
123 "",
124 "foo",
125 "foo bar",
126 "s1 s2 1 2 3 s3 4 s5 6",
127 }, func(logger *Logger) {
128 logger.Error("hello")
129 logger.Error("s1", "s2", 1, 2, 3, "s3", 4, "s5", 6)
130 logger.Errorf("%s world", "hello")
131 logger.Errorln()
132 logger.Errorln("foo")
133 logger.Errorln("foo", "bar")
134 logger.Errorln("s1", "s2", 1, 2, 3, "s3", 4, "s5", 6)
135 })
136}
137
138func TestLoggerFatalExpected(t *testing.T) {
139 checkMessages(t, zapcore.DebugLevel, nil, zapcore.FatalLevel, []string{

Callers

nothing calls this directly

Calls 4

checkMessagesFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45
ErrorlnMethod · 0.45

Tested by

no test coverage detected