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

Function TestLoggerHooks

logger_test.go:789–796  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

787}
788
789func TestLoggerHooks(t *testing.T) {
790 hook, seen := makeCountingHook()
791 withLogger(t, DebugLevel, opts(Hooks(hook)), func(logger *Logger, logs *observer.ObservedLogs) {
792 logger.Debug("")
793 logger.Info("")
794 })
795 assert.Equal(t, int64(2), seen.Load(), "Hook saw an unexpected number of logs.")
796}
797
798func TestLoggerConcurrent(t *testing.T) {
799 withLogger(t, DebugLevel, nil, func(logger *Logger, logs *observer.ObservedLogs) {

Callers

nothing calls this directly

Calls 6

makeCountingHookFunction · 0.85
optsFunction · 0.85
HooksFunction · 0.85
withLoggerFunction · 0.70
DebugMethod · 0.45
InfoMethod · 0.45

Tested by

no test coverage detected