dropLogger returns the active logger for the drop path, falling back to the shared Nop so callers never have to nil-check and an unwired manager is still safe to report against.
()
| 283 | // back to the shared Nop so callers never have to nil-check and an |
| 284 | // unwired manager is still safe to report against. |
| 285 | func (m *SyncMockManager) dropLogger() *zap.Logger { |
| 286 | m.loggerMu.RLock() |
| 287 | defer m.loggerMu.RUnlock() |
| 288 | if m.logger == nil { |
| 289 | return nopLogger |
| 290 | } |
| 291 | return m.logger |
| 292 | } |
| 293 | |
| 294 | // sendBudget is how long sendToOutChan will wait for outChan to drain |
| 295 | // before dropping the mock. 200 ms is sized conservatively: large |
no outgoing calls