()
| 144 | } |
| 145 | |
| 146 | func makeSamplerCountingHook() (h func(zapcore.Entry, zapcore.SamplingDecision), |
| 147 | dropped, sampled *atomic.Int64, |
| 148 | ) { |
| 149 | dropped = new(atomic.Int64) |
| 150 | sampled = new(atomic.Int64) |
| 151 | h = func(_ zapcore.Entry, dec zapcore.SamplingDecision) { |
| 152 | if dec&zapcore.LogDropped > 0 { |
| 153 | dropped.Add(1) |
| 154 | } else if dec&zapcore.LogSampled > 0 { |
| 155 | sampled.Add(1) |
| 156 | } |
| 157 | } |
| 158 | return h, dropped, sampled |
| 159 | } |
| 160 | |
| 161 | func TestConfigWithSamplingHook(t *testing.T) { |
| 162 | shook, dcount, scount := makeSamplerCountingHook() |
no test coverage detected