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

Function TestHookFires

hook_test.go:39–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestHookFires(t *testing.T) {
40 hook := new(TestHook)
41
42 LogAndAssertJSON(t, func(log *Logger) {
43 log.Hooks.Add(hook)
44 assert.False(t, hook.Fired)
45
46 log.Print("test")
47 }, func(fields Fields) {
48 assert.True(t, hook.Fired)
49 })
50}
51
52type ModifyHook struct {
53}

Callers

nothing calls this directly

Calls 3

LogAndAssertJSONFunction · 0.85
AddMethod · 0.80
PrintMethod · 0.65

Tested by

no test coverage detected