fxlog

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogger added in v1.14.0

func DefaultLogger(w io.Writer) fxevent.Logger

DefaultLogger constructs a Logger out of io.Writer.

Types

type Events added in v1.14.0

type Events []fxevent.Event

Events is a list of events captured by fxlog.Spy.

func (Events) Len added in v1.14.0

func (es Events) Len() int

Len returns the number of events in this list.

func (Events) SelectByTypeName added in v1.14.0

func (es Events) SelectByTypeName(name string) Events

SelectByTypeName returns a new list with only events matching the specified type.

type Spy added in v1.11.0

type Spy struct {
	// contains filtered or unexported fields
}

Spy is an Fx event logger that captures emitted events and/or logged statements. It may be used in tests of Fx logs.

func (*Spy) EventTypes added in v1.14.0

func (s *Spy) EventTypes() []string

EventTypes returns all captured event types.

func (*Spy) Events added in v1.14.0

func (s *Spy) Events() Events

Events returns all captured events.

func (*Spy) LogEvent added in v1.14.0

func (s *Spy) LogEvent(event fxevent.Event)

LogEvent appends an Event.

func (*Spy) Reset added in v1.11.0

func (s *Spy) Reset()

Reset clears all messages and events from the Spy.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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