MCPcopy
hub / github.com/kopia/kopia / contextWithLevelForCleanup

Function contextWithLevelForCleanup

internal/testlogging/ctx.go:50–54  ·  view source on GitHub ↗
(t testingT, level Level)

Source from the content-addressed store, hash-verified

48}
49
50func contextWithLevelForCleanup(t testingT, level Level) context.Context {
51 return logging.WithLogger(context.WithoutCancel(t.Context()), func(module string) logging.Logger {
52 return PrintfLevel(t.Logf, "["+module+"] ", level)
53 })
54}
55
56// ContextWithLevel returns a context with attached logger that emits all log entries with given log level or above.
57func ContextWithLevel(t testingT, level Level) context.Context {

Callers 1

ContextForCleanupFunction · 0.85

Calls 3

WithLoggerFunction · 0.92
PrintfLevelFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected