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

Function FatalfCtx

base/logging.go:145–158  ·  view source on GitHub ↗

FatalfCtx logs the given formatted string and args to the error log level and given log key and then exits.

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

Source from the content-addressed store, hash-verified

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) {
146 // no-op call to enable golang.org/x/tools/go/analysis/passes/printf checking in go vet
147 if false {
148 _ = fmt.Sprintf(format, args...)
149 }
150 // Fall back to stdlib's log.Panicf if SG loggers aren't set up.
151 if errorLogger.Load() == nil {
152 log.Fatalf(format, args...)
153 }
154 // ensure the log message always reaches console
155 ConsolefCtx(ctx, LevelError, KeyAll, format, args...)
156 FlushLogBuffers()
157 os.Exit(1)
158}
159
160// ErrorfCtx logs the given formatted string and args to the error log level and given log key.
161func ErrorfCtx(ctx context.Context, format string, args ...any) {

Callers 8

ServerMainFunction · 0.92
FatalfMethod · 0.85
getGocbClusterForTestFunction · 0.85
SetUpGlobalTestLoggingFunction · 0.85
FatalPanicHandlerFunction · 0.85
tbpBucketQuotaMBFunction · 0.85

Calls 4

ConsolefCtxFunction · 0.85
FlushLogBuffersFunction · 0.85
LoadMethod · 0.80
FatalfMethod · 0.45

Tested by

no test coverage detected