fxlog

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Printer
}

A Logger writes output to standard error.

func New

func New() *Logger

New returns a new Logger backed by the standard library's log package.

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...interface{})

Fatalf logs an Fx line then fatals.

func (*Logger) Panic

func (l *Logger) Panic(err error)

Panic logs an Fx line then panics.

func (*Logger) PrintProvide

func (l *Logger) PrintProvide(t interface{})

PrintProvide logs a type provided into the dig.Container.

func (*Logger) PrintSignal

func (l *Logger) PrintSignal(signal os.Signal)

PrintSignal logs an os.Signal.

func (*Logger) PrintSupply added in v1.12.0

func (l *Logger) PrintSupply(constructor interface{})

PrintSupply logs a type supplied directly into the dig.Container by the given constructor function.

func (*Logger) Printf

func (l *Logger) Printf(format string, v ...interface{})

Printf logs a formatted Fx line.

type Printer

type Printer interface {
	Printf(string, ...interface{})
}

Printer is a formatting printer.

type Spy added in v1.11.0

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

Spy is an Fx Printer that captures logged statements. It may be used in tests of Fx logs.

func (*Spy) Messages added in v1.11.0

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

Messages returns a copy of all captured messages.

func (*Spy) Printf added in v1.11.0

func (s *Spy) Printf(msg string, args ...interface{})

Printf logs the given message, formatting it in printf-style.

func (*Spy) Reset added in v1.11.0

func (s *Spy) Reset()

Reset clears all messages from the Spy.

func (*Spy) String added in v1.11.0

func (s *Spy) String() string

String returns all logged messages as a single newline-delimited string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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