adaptertest

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, subject Subject)

Run runs tests common to all logger.Adapter implementations.

Types

type InterfaceField

type InterfaceField struct {
	NestedField string
}

type Message

type Message struct {
	Level   logger.Level
	Message string
	// fields
	Error          string
	StringField    string
	IntField       int
	Int64Field     int64
	Float32Field   float32
	Float64Field   float64
	TimeField      time.Time
	InterfaceField InterfaceField
}

Message is a representation of the logged message.

type Subject

type Subject struct {
	// NewAdapter creates a new logger.Adapter instance
	NewAdapter func(io.Writer) logger.Adapter
	// UnmarshalMessage unmarshalls message as a string to Message struct
	UnmarshalMessage func(t *testing.T, line string) Message
}

Subject is configuration of logger.Adapter under test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL