github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/teams/logging.go (about) 1 package teams 2 3 import "golang.org/x/net/context" 4 5 type ctxKeyType string 6 7 const ctxKeySuppressLogging = ctxKeyType("sl") 8 9 func ShouldSuppressLogging(ctx context.Context) bool { 10 v, _ := ctx.Value(ctxKeySuppressLogging).(bool) 11 return v 12 } 13 14 func WithSuppressLogging(ctx context.Context, suppress bool) context.Context { 15 return context.WithValue(ctx, ctxKeySuppressLogging, suppress) 16 }