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

Function TestErrorHookShouldFireOnError

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

Source from the content-addressed store, hash-verified

162}
163
164func TestErrorHookShouldFireOnError(t *testing.T) {
165 hook := new(ErrorHook)
166
167 LogAndAssertJSON(t, func(log *Logger) {
168 log.Hooks.Add(hook)
169 log.Error("test")
170 }, func(fields Fields) {
171 assert.True(t, hook.Fired)
172 })
173}
174
175func TestAddHookRace(t *testing.T) {
176 var wg sync.WaitGroup

Callers

nothing calls this directly

Calls 3

LogAndAssertJSONFunction · 0.85
AddMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected