MCPcopy Create free account
hub / github.com/akash-network/provider / TestSingleModuleKey

Function TestSingleModuleKey

tools/logging/logger_test.go:113–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestSingleModuleKey(t *testing.T) {
114 buf := &bytes.Buffer{}
115 New(buf, mustConfig(t, "info", "json", false, "off", false)).
116 With("module", "a", "k", "v").
117 With("module", "b").
118 Info("m")
119
120 require.Equal(t, 1, strings.Count(buf.String(), `"module"`), buf.String())
121 lines := jsonLines(t, buf)
122 require.Equal(t, "b", lines[0]["module"])
123 require.Equal(t, "v", lines[0]["k"])
124}
125
126func TestModuleFilterBeforeEncoding(t *testing.T) {
127 buf := &bytes.Buffer{}

Callers

nothing calls this directly

Calls 6

mustConfigFunction · 0.85
jsonLinesFunction · 0.85
NewFunction · 0.70
InfoMethod · 0.65
WithMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected