MCPcopy
hub / github.com/sirupsen/logrus / TestLogger_SetBufferPool

Function TestLogger_SetBufferPool

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

Source from the content-addressed store, hash-verified

83}
84
85func TestLogger_SetBufferPool(t *testing.T) {
86 out := &bytes.Buffer{}
87 l := New()
88 l.SetOutput(out)
89
90 pool := new(testBufferPool)
91 l.SetBufferPool(pool)
92
93 l.Info("test")
94
95 assert.Equal(t, 1, pool.get, "Logger.SetBufferPool(): The BufferPool.Get() must be called")
96 assert.Len(t, pool.buffers, 1, "Logger.SetBufferPool(): The BufferPool.Put() must be called")
97}

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetOutputMethod · 0.80
SetBufferPoolMethod · 0.80
InfoMethod · 0.65

Tested by

no test coverage detected