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

Function TestErrorHookShouldntFireOnInfo

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

Source from the content-addressed store, hash-verified

151}
152
153func TestErrorHookShouldntFireOnInfo(t *testing.T) {
154 hook := new(ErrorHook)
155
156 LogAndAssertJSON(t, func(log *Logger) {
157 log.Hooks.Add(hook)
158 log.Info("test")
159 }, func(fields Fields) {
160 assert.False(t, hook.Fired)
161 })
162}
163
164func TestErrorHookShouldFireOnError(t *testing.T) {
165 hook := new(ErrorHook)

Callers

nothing calls this directly

Calls 3

LogAndAssertJSONFunction · 0.85
AddMethod · 0.80
InfoMethod · 0.65

Tested by

no test coverage detected