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

Function TestRedactf

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

Source from the content-addressed store, hash-verified

36}
37
38func TestRedactf(t *testing.T) {
39 backend := InitForTesting(DEBUG)
40 password := Password("123456")
41 log := MustGetLogger("test")
42 log.Debugf("foo %s", password)
43 if "foo ******" != MemoryRecordN(backend, 0).Formatted(0) {
44 t.Errorf("redacted line: %v", MemoryRecordN(backend, 0).Formatted(0))
45 }
46}
47
48func TestPrivateBackend(t *testing.T) {
49 stdBackend := InitForTesting(DEBUG)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected