MCPcopy
hub / github.com/sirupsen/logrus / TestEntryHooksPanic

Function TestEntryHooksPanic

entry_test.go:216–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

214}
215
216func TestEntryHooksPanic(t *testing.T) {
217 logger := New()
218 logger.Out = &bytes.Buffer{}
219 logger.Level = InfoLevel
220 logger.Hooks.Add(&panickyHook{})
221
222 defer func() {
223 p := recover()
224 assert.NotNil(t, p)
225 assert.Equal(t, panicMessage, p)
226
227 entry := NewEntry(logger)
228 entry.Info("another message")
229 }()
230
231 entry := NewEntry(logger)
232 entry.Info(badMessage)
233}
234
235func TestEntryWithIncorrectField(t *testing.T) {
236 assert := assert.New(t)

Callers

nothing calls this directly

Calls 4

InfoMethod · 0.95
NewFunction · 0.85
NewEntryFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected