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

Function makeCountingHook

logger_test.go:40–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38)
39
40func makeCountingHook() (func(zapcore.Entry) error, *atomic.Int64) {
41 count := &atomic.Int64{}
42 h := func(zapcore.Entry) error {
43 count.Add(1)
44 return nil
45 }
46 return h, count
47}
48
49func TestLoggerAtomicLevel(t *testing.T) {
50 // Test that the dynamic level applies to all ancestors and descendants.

Callers 2

TestConfigFunction · 0.85
TestLoggerHooksFunction · 0.85

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected