MCPcopy Index your code
hub / github.com/foxcpp/maddy / Logger

Function Logger

internal/testutils/logger.go:36–61  ·  view source on GitHub ↗
(t *testing.T, name string)

Source from the content-addressed store, hash-verified

34)
35
36func Logger(t *testing.T, name string) *log.Logger {
37 if *directLog {
38 return &log.Logger{
39 Parent: &log.DefaultLogger, // silence "no parent" warning
40 Out: log.WriterOutput(os.Stderr, true),
41 Name: name,
42 Debug: *debugLog,
43 }
44 }
45
46 return &log.Logger{
47 Parent: &log.DefaultLogger,
48 Out: log.FuncOutput(func(_ time.Time, debug bool, str string) {
49 t.Helper()
50 str = strings.TrimSuffix(str, "\n")
51 if debug {
52 str = "[debug] " + str
53 }
54 t.Log(str)
55 }, func() error {
56 return nil
57 }),
58 Name: name,
59 Debug: *debugLog,
60 }
61}

Callers 15

TestCreateSASLFunction · 0.92
testEndpointFunction · 0.92
TestStoreFunction · 0.92
TestSMTPUTF8Function · 0.92
TestFileReloadFunction · 0.92
TestFileReload_BrokenFunction · 0.92
TestFileReload_RemovedFunction · 0.92
newTestModifierFunction · 0.92
TestKeyLoad_newFunction · 0.92
TestMsgPipeline_ChecksFunction · 0.92

Calls 2

WriterOutputFunction · 0.92
FuncOutputFunction · 0.92

Tested by 15

TestCreateSASLFunction · 0.74
testEndpointFunction · 0.74
TestStoreFunction · 0.74
TestSMTPUTF8Function · 0.74
TestFileReloadFunction · 0.74
TestFileReload_BrokenFunction · 0.74
TestFileReload_RemovedFunction · 0.74
newTestModifierFunction · 0.74
TestKeyLoad_newFunction · 0.74
TestMsgPipeline_ChecksFunction · 0.74