For example, it's impossible to recover from a logger.Panic in a tests if that log is emitted in another go routine. This is exactly the case with our periodic runner library.
The best approach we came up with was extending zap to support passing a custom onPanic hook like we have for onFatal.
There can be complications when testing Panic/DPanic logs similarly to Fatal logs as described in https://github.com/uber-go/zap/issues/846.
For example, it's impossible to recover from a logger.Panic in a tests if that log is emitted in another go routine. This is exactly the case with our periodic runner library.
The best approach we came up with was extending zap to support passing a custom onPanic hook like we have for onFatal.