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

Method DPanic

logger.go:273–277  ·  view source on GitHub ↗

DPanic logs a message at DPanicLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger. If the logger is in development mode, it then panics (DPanic means "development panic"). This is useful for catching errors that are recoverable, but should

(msg string, fields ...Field)

Source from the content-addressed store, hash-verified

271// "development panic"). This is useful for catching errors that are
272// recoverable, but shouldn't ever happen.
273func (log *Logger) DPanic(msg string, fields ...Field) {
274 if ce := log.check(DPanicLevel, msg); ce != nil {
275 ce.Write(fields...)
276 }
277}
278
279// Panic logs a message at PanicLevel. The message includes any fields passed
280// at the log site, as well as any fields accumulated on the logger.

Callers 3

TestLoggerDPanicFunction · 0.45
TestNopLoggerFunction · 0.45

Calls 2

checkMethod · 0.95
WriteMethod · 0.65

Tested by 3

TestLoggerDPanicFunction · 0.36
TestNopLoggerFunction · 0.36