MCPcopy
hub / github.com/op/go-logging / TestRedact

Function TestRedact

logger_test.go:28–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestRedact(t *testing.T) {
29 backend := InitForTesting(DEBUG)
30 password := Password("123456")
31 log := MustGetLogger("test")
32 log.Debug("foo", password)
33 if "foo ******" != MemoryRecordN(backend, 0).Formatted(0) {
34 t.Errorf("redacted line: %v", MemoryRecordN(backend, 0))
35 }
36}
37
38func TestRedactf(t *testing.T) {
39 backend := InitForTesting(DEBUG)

Callers

nothing calls this directly

Calls 7

InitForTestingFunction · 0.85
MustGetLoggerFunction · 0.85
MemoryRecordNFunction · 0.85
DebugMethod · 0.80
FormattedMethod · 0.80
ErrorfMethod · 0.80
PasswordTypeAlias · 0.70

Tested by

no test coverage detected