logur: logur.dev/logur/conformance Index | Files

package conformance

import "logur.dev/logur/conformance"

Index

Package Files

conformance.go levels.go

type TestLogger Uses

type TestLogger interface {
    // Events returns all recorded events in the logger.
    Events() []logur.LogEvent
}

TestLogger acts as a recorder for the Logger under test.

type TestLoggerFunc Uses

type TestLoggerFunc func() []logur.LogEvent

TestLoggerFunc converts an event function to a TestLogger if it's definition compatible with the interface.

func (TestLoggerFunc) Events Uses

func (fn TestLoggerFunc) Events() []logur.LogEvent

type TestSuite Uses

type TestSuite struct {
    LoggerFactory func(level logur.Level) (logur.Logger, TestLogger)

    NoTraceLevel bool
}

TestSuite runs a set of conformance tests against a logger.

func (TestSuite) Run Uses

func (s TestSuite) Run(t *testing.T)

Run executes the complete test suite.

func (TestSuite) RunLevelContextTest Uses

func (s TestSuite) RunLevelContextTest(t *testing.T)

RunLevelContextTest tests leveled logging capabilities of a LoggerContext. Note: this is not mandatory, incompatible loggers will be skipped.

func (TestSuite) RunLevelEnablerTest Uses

func (s TestSuite) RunLevelEnablerTest(t *testing.T)

RunLevelEnablerTest tests enabled levels. Note: this is not mandatory, incompatible loggers will be skipped. nolint: gocognit

func (TestSuite) RunLevelTest Uses

func (s TestSuite) RunLevelTest(t *testing.T)

RunLevelTest tests leveled logging capabilities of a Logger.

Package conformance imports 4 packages (graph) and is imported by 1 packages. Updated 2020-07-28. Refresh now. Tools for package owners.