MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / PanicfCtx

Function PanicfCtx

base/logging.go:133–142  ·  view source on GitHub ↗

PanicfCtx logs the given formatted string and args to the error log level and given log key and then panics.

(ctx context.Context, format string, args ...any)

Source from the content-addressed store, hash-verified

131
132// PanicfCtx logs the given formatted string and args to the error log level and given log key and then panics.
133func PanicfCtx(ctx context.Context, format string, args ...any) {
134 // Fall back to stdlib's log.Panicf if SG loggers aren't set up.
135 if errorLogger.Load() == nil {
136 log.Panicf(format, args...)
137 }
138 // ensure the log message always reaches console
139 ConsolefCtx(ctx, LevelError, KeyAll, format, args...)
140 FlushLogBuffers()
141 panic(fmt.Sprintf(format, args...))
142}
143
144// FatalfCtx logs the given formatted string and args to the error log level and given log key and then exits.
145func FatalfCtx(ctx context.Context, format string, args ...any) {

Calls 3

ConsolefCtxFunction · 0.85
FlushLogBuffersFunction · 0.85
LoadMethod · 0.80

Tested by

no test coverage detected