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

Method AddDatabaseLogContext

db/database.go:2164–2170  ·  view source on GitHub ↗

LOGGING AddDatabaseLogContext adds database name to the parent context for logging

(ctx context.Context)

Source from the content-addressed store, hash-verified

2162
2163// AddDatabaseLogContext adds database name to the parent context for logging
2164func (dbCtx *DatabaseContext) AddDatabaseLogContext(ctx context.Context) context.Context {
2165 if dbCtx != nil && dbCtx.Name != "" {
2166 dbLogCtx := base.DatabaseLogCtx(ctx, dbCtx.Name, dbCtx.Options.LoggingConfig)
2167 return dbLogCtx
2168 }
2169 return ctx
2170}
2171
2172// AddBucketUserLogContext adds bucket user to the parent context for logging. This is used to mark actions not caused by a user.
2173func (dbCtx *DatabaseContext) AddBucketUserLogContext(ctx context.Context) context.Context {

Calls 1

DatabaseLogCtxFunction · 0.92