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

Function TestEntryLogfLevel

entry_test.go:260–272  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestEntryLogfLevel(t *testing.T) {
261 logger := New()
262 buffer := &bytes.Buffer{}
263 logger.Out = buffer
264 logger.SetLevel(InfoLevel)
265 entry := NewEntry(logger)
266
267 entry.Logf(DebugLevel, "%s", "debug")
268 assert.NotContains(t, buffer.String(), "debug")
269
270 entry.Logf(WarnLevel, "%s", "warn")
271 assert.Contains(t, buffer.String(), "warn")
272}
273
274func TestEntryReportCallerRace(t *testing.T) {
275 logger := New()

Callers

nothing calls this directly

Calls 5

LogfMethod · 0.95
NewFunction · 0.85
NewEntryFunction · 0.85
SetLevelMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…