countingRedactor counts how many times each redaction hook fires. Used to assert the redaction-once invariant — a single outer redactingCore should run RedactEntry/RedactField exactly once per log call, not 2x because of the tee.
| 194 | // redactingCore should run RedactEntry/RedactField exactly once per |
| 195 | // log call, not 2x because of the tee. |
| 196 | type countingRedactor struct { |
| 197 | entries int64 |
| 198 | fields int64 |
| 199 | encoded int64 |
| 200 | } |
| 201 | |
| 202 | func (r *countingRedactor) RedactEntry(ent *zapcore.Entry) { |
| 203 | atomic.AddInt64(&r.entries, 1) |
nothing calls this directly
no outgoing calls
no test coverage detected